Single plus operator in javascript [duplicate]
Solution 1:
The plus converts a string to a float. The code you provided is equivalent to the following:
if ( obj.length === Number(obj.length) ) {
// ...
}
The plus converts a string to a float. The code you provided is equivalent to the following:
if ( obj.length === Number(obj.length) ) {
// ...
}