just-clone clone Date bug

node v8.17.0
version: master
endpointsharetweet
const clone = require('just-clone') const arr = [1, 2, 3]; const subObj = {aa: 1}; const obj = {a: 3, b: 5, c: arr, d: subObj, e: new Date(), f: null}; const objClone = clone(obj); arr.push(4); subObj.bb = 2; obj; // {a: 3, b: 5, c: [1, 2, 3, 4], d: {aa: 1}} objClone; // {a: 3, b: 5, c: [1, 2, 3], d: {aa: 1, bb: 2}}
Created from: http://anguscroll.com/just/just-clone
Loading…

no comments

    sign in to comment