var variablename1 = [...value];
let colors = ['Red', 'Yellow']; let newColors = [...colors, 'Violet', 'Orange', 'Green']; console.log(newColors);
[ 'Red', 'Yellow', 'Violet', 'Orange', 'Green' ]
let colors = ['Red', 'Yellow']; let newColors = [...colors, 'Violet', 'Orange', 'Green']; console.log(newColors);
[ 'Red', 'Yellow', 'Violet', 'Orange', 'Green' ]
let colors = ['Red', 'Yellow']; let newColors = [...colors]; console.log(newColors);
[ 'Red', 'Yellow' ]
let colors = ['Red', 'Yellow']; let newColors = colors; newColors.push('Green'); console.log(newColors); console.log(colors);
[ 'Red', 'Yellow', 'Green' ] [ 'Red', 'Yellow', 'Green' ]
let colors = ['Red', 'Yellow']; let newColors = [...colors]; newColors.push('Green'); console.log(newColors); console.log(colors);
[ 'Red', 'Yellow', 'Green' ] [ 'Red', 'Yellow' ]
let str = ['A', ...'EIO', 'U']; console.log(str);
[ 'A', 'E', 'I', 'O', 'U' ]