I\’m testin some JavaScript concepts and I\’m trying to understand why:
typeof({} + {})
typeof([] + [])
return a \’string\’ yet:
typeof {}
typeof []
return an \’object\’
I\’ve tried this in NodeJS, FireFox, Chrome and IE9 all with the same results.





Rating:
The post JavaScript array and object addition appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/javascript-array-and-object-addition.html
No comments:
Post a Comment