Merge pull request #603 from luckyorange/master
Replaced obj.constructor with Array.isArray
This commit is contained in:
commit
5f34edc8c7
@ -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