Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

deep clone array in javascript

const numbers = [1, [2], [3, [4]], 5];

// Using JavaScript
JSON.parse(JSON.stringify(numbers));

// Using Lodash
_.cloneDeep(numbers);
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #deep #clone #array #javascript
ADD COMMENT
Topic
Name
9+9 =