A suggestion for this topic Basic Data Structures: Copy an Array with the Spread OperatorPassed

Here the output required is not correct like they ask to use spread operator for

[ [ true, false, true ], [ true, false, true ] ]

Here this can be achieved using simple

newArray(arr)

instead of

newArray([...arr])

so my suggestion was instead they should ask for the following output

[ true, false, true, true, false, true ]

this can be achieved using

newArray(...arr)

Hello there,

The point of the function copyMachine is to take in one arr, and produce num copies. Not to extend the arr.

-> Function takes in [true, false, true]
-> Should return num copies (in this case 2)
-> First copy: [true, false, true]
-> Second copy: [true, false, true]

The following is not 2 copies of the arr:

[ true, false, true, true, false, true ]

Hope this clarifies.

For others wanting to confirm: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator