Why does 2+ 40 equal 42?

That character is “OGHAM SPACE MARK”, which is a space character. So the code is equivalent to alert(2+ 40).

I’d also like to know if there are more characters behaving like this.

Any Unicode character in the Zs class is a white space character in JavaScript, but there don’t seem to be that many.

However, JavaScript also allows Unicode characters in identifiers, which lets you use interesting variable names like ಠ_ಠ.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)