logoalt Hacker News

aktenlage • today at 10:45 AM • 2 replies • view on HN

What's the purpose of the +x at the end?


Replies

undecidabot • today at 10:57 AM

The unary plus implicitly converts an expression to a number, which calls `valueOf` for non-primitive values.

➕ show 1 reply
emaro • today at 10:49 AM

I think to implicitly trigger the valueOf function.

➕ show 1 reply