Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript clone object

var x = {myProp: "value"};
var xClone = Object.assign({}, x);

//Obs: nested objects are still copied as reference.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #clone #object
ADD COMMENT
Topic
Name
3+8 =