Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by aktenlage

3 days ago

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

4 comments

aktenlage

Reply

undecidabot  3 days ago

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

  • aktenlage  3 days ago

    Thank you

emaro  3 days ago

I think to implicitly trigger the valueOf function.

  • aktenlage  3 days ago

    Thank you

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities