Open rdeangelis83 opened 3 years ago
Method isInstanceOf (used in each method) doesn't work correctly for arrays created in a different frame. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
isInstanceOf
each
Array.isArray is the better alternative but is not implemented in all browser so I would suggest following:
function isArray(obj) { if (Array.isArray && Array.isArray(obj)) { return true; } if (isInstanceOf(obj, Arr)) { return true; } if (Object.prototype.toString.call(obj) === "[object Array]") { return true; } return false; } }
Could you help to make a PR for it?
Of course. I will make a PR this evening.
Method
isInstanceOf
(used ineach
method) doesn't work correctly for arrays created in a different frame. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArrayArray.isArray is the better alternative but is not implemented in all browser so I would suggest following: