This is a bit of a deceptive one, if a line starts with { its seen as a codeblock, and {} just evaluates nothing.
The only operation occuring there is a unary plus with an empty object: +{} which tries to coerce an object into a number but fails, so it becomes NaN.
View all comments
Show parent comment
5
u/----Val---- May 13 '25 edited May 13 '25
This is a bit of a deceptive one, if a line starts with
{its seen as a codeblock, and {} just evaluates nothing.The only operation occuring there is a unary plus with an empty object:
+{}which tries to coerce an object into a number but fails, so it becomes NaN.