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.
More Related Contents:
- JavaScript Syntax error
- What’s the meaning of “=>” (an arrow formed from equals & greater than) in JavaScript?
- Add a property to a JavaScript object using a variable as the name?
- Location of parenthesis for auto-executing anonymous JavaScript functions?
- ++someVariable vs. someVariable++ in JavaScript
- What do parentheses surrounding an object/function/class declaration mean? [duplicate]
- How does this JavaScript/jQuery syntax work: (function( window, undefined ) { })(window)?
- What does the leading semicolon in JavaScript libraries do?
- Why avoid increment (“++”) and decrement (“–“) operators in JavaScript?
- What does “options = options || {}” mean in Javascript? [duplicate]
- Why do results vary based on curly brace placement?
- How do I convert a float number to a whole number in JavaScript?
- Javascript: Get deep value from object by passing path to it as string [duplicate]
- Difference between (function(){})(); and function(){}(); [duplicate]
- Immediate function invocation syntax
- Is && statement() the same as if() statement()?
- How can I concatenate regex literals in JavaScript?
- Javascript Property with three dots (…)
- Explain +var and -var unary operator in javascript
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Difference between var and this in Javascript functions?
- What is the decimal separator symbol in JavaScript?
- Function and variable with the same name
- How can % signs be used in identifiers
- What is “?:” notation in JavaScript?
- Javascript while loop return value
- ES6+ javascript module export options
- Using a block’s return value in JavaScript
- JQuery .hasClass for multiple values in an if statement
- What does ‘::’ (double colon) do in JavaScript?