Merge pull request #603 from luckyorange/master

Replaced obj.constructor with Array.isArray
This commit is contained in:
Hyunje Jun 2017-01-11 00:59:45 +09:00 committed by GitHub
commit 5f34edc8c7

View File

@ -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 = {};