How do I create a function accepts two parameters, the first is a list element that should be added to, the second is an array of strings that will be turned into list items.
The parameters were the element and the arr. I tried to create the list element and append the array strings into the element using appendChild.
function filler(elem, arr){
elem = document.createElement("li");
for(let i = 0; i < arr.length; i++){
elem.appendChild(arr[i]);
}
}
Error message:
Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.