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
Copy-by-Reference Demo
node v4.9.1
version:
master
endpoint
share
tweet
const array = [1,2,3] let newArray = array; newArray.push(4); console.log("array", array); console.log("newArray", newArray);
const object = { a: 1, b: 2 } let newObject = object; newObject.a = 100; console.log("object", object); console.log("newObject", newObject);
Loading…
no comments
sign in
to comment