Codington
0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Copy an Array with Slice

Calling .slice() without arguments creates a shallow copy of an array.

Example

const original = [1, 2]; const copy = original.slice();

Your task

Copy original into copy, push three only to the copy, and display both arrays.