I keep getting an error in the console that .split is not a function. Here is my code:
function addEnds(list) {
var array = new Array();
array = list.split(',');
console.log(array);
}
Basically, I want the list to equal a series of number separated by a comma, example: 1,2,3,4,5, and am trying to put those into an array. I've researched about using .split but for some reason, I'm just not getting it.

splitis a string method, are you calling your function like addEnds("1,2,3,4,5") ?list, but you haven’t shown that. Also, you don’t need to initialize the array like that.split()will make a new array.function addEnds(...list) { return list; }- orfunction addEnds() { return Array.from(arguments));or evenfunction addEnds() { return Array.prototype.slice.call(arguments);}... those three all do the same thing on older and older browsersaddEnds(‘2,3,5,8,0’)