getify / You-Dont-Know-JS

A book series on JavaScript. @YDKJS on twitter.
Other
179.26k stars 33.48k forks source link

view shallow copy output #1776

Open Jeroendevr opened 2 years ago

Jeroendevr commented 2 years ago

Just a addition so the reader knows what the output of this shallow copy is using the spread operator. As I myself was wondering if there is a difference between var arrCopy = [ ...arr ]; or arrCopy = arr; Specifically quoting these guidelines regarding typos:

I already searched for this issue

Edition: (pull requests not accepted for previous editions) 2 Book Title: get-started Chapter: 3 Section Title: Iterables Topic:

getify commented 2 years ago

Not sure if I want to add this or not, but I'll keep the suggestion around to consider for future revisions.