I was working on a problem in the Redux section and was unsure why my solution was unable to append a new todo item to a copy of the original array.
I noticed that example1 returns an integer, while example2 returns the desired array. Why is this?
My frame of thinking for example1 was that I am making a copy of a new array with slice(), and then pushing a string to the end of the copied array.
Thank you
`const sampleArr = [‘arg’, ‘hoy’, ‘matey’, ‘pie’, ‘tings’];
const exmaple1 = sampleArr.slice().push(‘example one’);
const example2 = sampleArr.concat(‘example two’);
console.log(exmaple1);
console.log(example2);`