Replaced obj.constructor with Array.isArray

This commit is contained in:
Hayden Gascoigne 2017-01-09 13:44:32 -06:00
parent d5db8ca18e
commit 9c485584b9

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