1let arr =["a","b","c"];
2// ES6 way
3const copy = [...arr];
4
5// older method
6const copy = Array.from(arr);
1const sheeps = ['Apple', 'Banana', 'Juice'];
2
3// Old way
4const cloneSheeps = sheeps.slice();
5
6// ES6 way
7const cloneSheepsES6 = [...sheeps];
1workers = workers.map(employee =>
2 employee.occupation == "Iron Man" ? (employee.occupation = "Philantropist", employee) : (employee.occupation, employee)
3);
4