copying an array

PHOTO EMBED

Mon Mar 01 2021 03:05:49 GMT+0000 (Coordinated Universal Time)

Saved by @MattMoniz #javascript

const manipulateList = (list) => {
  // defensively copy list
  const copiedList = [...list]

  // do something with copiedList
}
content_copyCOPY

https://www.benmvp.com/blog/learning-es6-12-tricks-for-es6-fun/