Closed zaideygrek closed 7 years ago
zaideygrek, thanks for the recommendation. I do remember a while back considering which way to use and found that they return different results when passing in an array. See here: http://jsbin.com/fadifiwefu/edit?js,console
If you think there could be a performance improvement with one over the other I can look into adding the change and rerunning the unit tests to see if anything breaks. Thanks for the recommendation, let me know your thoughts.
-Tom
Hello tom thanks for reply,
I have the problem when I get back the object $resource from angular. obj.constructor is no equal to object. I would recommend you code: http://jsbin.com/saditapato/edit?js,console
Alex
Thanks zaideygrek, I will take a look this weekend. Sorry for the delayed response.
zaideygrek,
I made your recommended changes and to my surprise I had a lot of unit tests fail. The problem is the javascript function Array.isArray() returns false on the arguments array. See here for my demo http://jsbin.com/cabajukida/edit?js,console
Of course, thanks for your job !
When we want to check an object, it seems preferable to use "typeof".
to