function myForEach(arr, fun) {
    for (var i = 0; i < arr.length; i += 1) {
        fun(arr[i], i, arr);
    }
}
/* Stand-alone function
 * 
 * This is not a method associated with an object, therefore, the array
 * that is traversed shall be provided as the first argument to the function.
 *
 * arr - The array that will be traversed
 * fun - the function that will be applied to each item in the array
 */
Stand-alone function

This is not a method associated with an object, therefore, the array
that is traversed shall be provided as the first argument to the function.

The array that will be traversed
fun - the function that will be applied to each item in the array
Stand - alone function This is not a method associated with an object therefore the array that is traversed shall be provided as the first argument to the function . The array that will be traversed fun - the function that will be applied to each item in the array
function myForEach(arr, fun) {
    for (var i = 0; i < arr.length; i += 1) {
        fun(arr[i], i, arr);
    }
}
function myForEach ( arr , fun ) { for ( var i = 0 ; i < arr . length ; i += 1 ) { fun ( arr [ i ] , i , arr ) ; } }
Stand-alone function
Stand - alone function