How to use 'javascript foreach reverse' in JavaScript

Every line of 'javascript foreach reverse' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
84export function eachReverse(array, fn) {
85 var i = array.length;
86 while (i--) {
87 fn(array[i], i);
88 }
89}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

44function eachReverse(ary, func) {
45 if (ary) {
46 var i;
47 for (i = ary.length - 1; i > -1; i -= 1) {
48 if (ary[i] && func(ary[i], i, ary)) {
49 break;
50 }
51 }
52 }
53}

Related snippets