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) {
|
var clone = exports.clone = function (obj) {
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
return null;
|
return null;
|
||||||
} else if (obj.constructor === Array) {
|
} else if (Array.isArray(obj)) {
|
||||||
return obj.map(clone);
|
return obj.map(clone);
|
||||||
} else if (typeof obj === 'object') {
|
} else if (typeof obj === 'object') {
|
||||||
var result = {};
|
var result = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user