Back to discussionComment by tuukkah[-]tuukkah4 years ago1 reply#... is the spread syntax, which is a neat way to use the entries of an existing array or object in an argument list or within an array or object literal.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...Array(length) creates an array that has a length but no elements (or weird, "empty" elements). The square brackets create a new array [...Array(length)] which will have undefined elements instead, as trying to access an "empty" element returns undefined.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...prox4 years ago#That is neat! Thanks!
tuukkah4 years ago1 reply#... is the spread syntax, which is a neat way to use the entries of an existing array or object in an argument list or within an array or object literal.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...Array(length) creates an array that has a length but no elements (or weird, "empty" elements). The square brackets create a new array [...Array(length)] which will have undefined elements instead, as trying to access an "empty" element returns undefined.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Array(length) creates an array that has a length but no elements (or weird, "empty" elements). The square brackets create a new array [...Array(length)] which will have undefined elements instead, as trying to access an "empty" element returns undefined.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...