Replaced obj.constructor with Array.isArray
This commit is contained in:
parent
d5db8ca18e
commit
9c485584b9
@ -10,7 +10,7 @@ var toInt = exports.toInt = function (x) {
|
||||
var clone = exports.clone = function (obj) {
|
||||
if (!obj) {
|
||||
return null;
|
||||
} else if (obj.constructor === Array) {
|
||||
} else if (Array.isArray(obj)) {
|
||||
return obj.map(clone);
|
||||
} else if (typeof obj === 'object') {
|
||||
var result = {};
|
||||
|
Loading…
Reference in New Issue
Block a user