Q:

Write a JavaScript program to execute a provided function once for each array element, starting from the array's last element

0

Write a JavaScript program to execute a provided function once for each array element, starting from the array's last element.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const forEachRight = (arr, callback) =>
  arr
    .slice(0)
    .reverse()
    .forEach(callback);
forEachRight([1, 2, 3, 4], val => console.log(val));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now