+ operator before expression in javascript: what does it do?

The unary + operator can be used to convert a value to a number in JavaScript. Underscore appears to be testing that the .length property is a number, otherwise it won’t be equal to itself-converted-to-a-number.

Leave a Comment