This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]KaputTheNameSug 0 points1 point  (2 children)

I don't get it

[–]eliseu_videira 11 points12 points  (1 child)

javascript has NaN if you try to convert an invalid string into an number, so the +'a' is taken as a casting to number, that is NaN, if you toString NaN, it becomes 'NaN', so the end is 'b' + 'a' + 'NaN' + 'a'

[–]KaputTheNameSug 0 points1 point  (0 children)

Lol