Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
just-clone clone Date bug
node v8.17.0
version:
master
endpoint
share
tweet
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