I am to finish the function below. I am to loop through the arr paramteter using a for loop and add the string "Duck" to the end of each element (i.e. arr[0] = "yellow"; should become "yellowDuck".
Here is what I am given to start with:
function addDucks(arr, ind) {
//WRITE YOUR FOR-LOOP HERE
//For your iterator, declare it with the let keyword, and name it "i"
//DO NOT TOUCH THIS
return [arr, ind]
}
Here is the code I am trying:
function addDucks(arr, ind) {
for (let i = 0; i < arr.length; i++) {
return arr[i] + 'Duck';
}
return [arr, ind]
}
should return an array the first element of the returned array should be the passed-in array with "Duck" added to every element the second element of the returned array should be 3 when passed [1, 2, 3], 3