rmoran86.hashnode.devCopying JavaScript object and arraysI recently learned this method: Copying a JavaScript Object const source = { a: 1, b: 2 }; const copy = Object.assign({}, source); Copying a JavaScript Array const arr = [0,2,3,4,5]; const arrCopy = arr.slice(0); These two functions come handy when y...Jul 8, 2020·1 min read