Use Array#isArray instead of instanceof
Opened this issue · 2 comments
rauchg commented
And if you plan to support browser, use this instead
/**
* Checks for Array type.
*
* @param {Object} object
* @api private
*/
function isArray (obj) {
return '[object Array]' == Object.prototype.toString.call(obj);
};
rauchg commented
This also applies to dref.js
crcn commented
I think generally it'd be good practice for me to start using Array.isArray versus value instanceof Array
for this very reason. Made note of it. Thanks for pointing it out.