what is the difference between split and slice method in javascript?
const secretMessage = animals.map(names => {
return names[0].slice();
const secretMessage = animals.map(names => {
return names[0].split();
})
``` I log them both in the console and yield same result .
The main confusion you seem to have is that you need to pass parameters into both of the methods. slice takes a to and from index of where it is slicing, and split takes a separator parameter on what to split around.