The plus converts a string to a float. The code you provided is equivalent to the following:
if ( obj.length === Number(obj.length) ) {
// ...
}
More Related Contents:
- phone number validation in js [closed]
- Share data between AngularJS controllers
- When is .then(success, fail) considered an antipattern for promises?
- How to show the “Are you sure you want to navigate away from this page?” when changes committed?
- Multi-row insert with pg-promise
- Render basic HTML view?
- Memory leak risk in JavaScript closures
- Using querySelectorAll to retrieve direct children
- JavaScript double colon (bind operator)
- window.open with headers
- Difference between console.log and return in javascript? [closed]
- SyntaxError: expected expression, got ‘
- How to know if a function is async?
- How to make a radio button unchecked by clicking it?
- Embedding SVG into ReactJS
- Simple ajax form using javascript no jQuery
- How does !!~ (not not tilde/bang bang tilde) alter the result of a ‘contains/included’ Array method call?
- JavaScript function similar to Python range()
- Discord API valid intents must be provided for the client [duplicate]
- Difference between Array.length = 0 and Array =[]?
- Is there a way to get Chai working with asynchronous Mocha tests?
- angular 4+ assign @Input for ngComponentOutlet dynamically created component
- A plain JavaScript way to decode HTML entities, works on both browsers and Node
- Why need useRef and not mutable variable?
- ScrollTo function in AngularJS
- Running Node.js in apache?
- Is there a good use case for the constructor property in Javascript?
- ember.js + handlebars: render vs outlet vs partial vs view vs control
- How to apply background-color to a selected option?
- onChange event with contenteditable [duplicate]