Can someone explain to me the difference between assigning an array directly, using spread operator and the slice method in JavaScript? For instance:
const a = [1,2,3,4,5];
const b = a;
const c = a.slice();
const d = [...a];
What is the difference between b, c and d arrays ? Has it got something to do with shallow and deep copies?