Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript clone list of objects

let sheeps = [
  { height: 20, name: 'Melvin' },
  { height: 18, name: 'Betsy' },
];
let clonedSheeps = sheeps.map((sheep) => ({ ...sheep }));
 
PREVIOUS NEXT
Tagged: #javascript #clone #list #objects
ADD COMMENT
Topic
Name
5+6 =