I have a method that populates an array.
I would like to utilize it in this manner: arrayname.fill("First Array");
And not like this: arrayname = fill("First Array");
What approach should I take?
function fillArray(name)
{
let newArray = [];
for(let i = 0; i < 3; i++)
{
newArray[i] = prompt(name + "\nPlease enter a value:");
}
return newArray;
}