What is unary + used for in Javascript?
javascript
Solution
`+length` is a method to convert anything to a number.
If it's a number, the value doesn't change, and the comparison returns true. If it's not a number, the assertion is false.
Problem
I have found some code from Underscore.js ``` _.map = _.collect = function(obj, iterator, context) { var results = []; if (obj == null) return results; if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); each(obj, function(value, index, list) { results[results.length] = iterator.call(context, value, index, list); }); if (obj.length === +obj.length) results.length = obj.length; return results; }; ``` I would like to know what `if (obj.length === +obj.length)` does?