Possible Duplicate:
javascript: plus symbol before variable
obj.length === +obj.length in javascript
While looking at the source of underscore.js I came across this line (#79)
//some stuff
} else if (obj.length === +obj.length) {
//do stuff
I'm not 100% certain of whats going on here, can anyone explain the purpose of the '+' before the obj.length value?? Would the comparison be identical if it just read:
} else if (obj.length === obj.length) {
The same type of comparison is made multiple times in underscore.js, so I'm fairly certain it's not a typo.
If anyone could point me to an article, or throw some correct terminology at me, I'd appreciate it :). Thanks!