1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1× 8× 1× 7× 7× 7× 12× 5× 7× | /** * Clones an object but misses a key. */ module.exports = function cloneWithout (object, key) { if (Array.isArray(object)) { return object.slice(0, +key).concat(object.slice(+key + 1)) } else { var result = {} key = '' + key for (var k in object) { if (object.hasOwnProperty(k) && key !== k) { result[k] = object[k] } } return result } } |