▲ 1 points
back
2 comments
This character is "OGHAM SPACE MARK"[1], which is a space character. So the code is equivalent to alert(2+ 40). From what I know, any unicode character in the Zs class is a white space character in JS[2], but there don't seem to be that many[3]. However, JS also allows unicode characters in identifiers[4], which lets you use interesting variable names like ಠ_ಠ
[1]: https://codepoints.net/U+1680
[2]: https://www.ecma-international.org/ecma-262/6.0/#sec-white-s....
[3]: https://codepoints.net/search?q=&na=&int=&gc[]=Zs&Bidi_M=&Bi....
[4]: https://mathiasbynens.be/notes/javascript-identifiers-es6
Hi,
I don't really get your point. This character is clearly not the minus character - (apart that they don't actually look alike, just compare the codes, minus is 45, this one is 5760).
So nothing out of the ordinary that this special character is ignored by the JS engine. You can put it almost anywhere it will just toss it while processing the command. Hence, this works too
$ ( "#result" ). append (2 + 40) ;