There is one function that I am stuck on with incrementing all of the items in my array and returning the array. What to do now?
function incrementByOne(arr) {
// arr is an array of integers(numbers), Increment all items in the array by
// return the array
for (let i = 0; i < arr.length; i++) {
arr[i] += 1;
return(arr);
}
}
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment