public/js-roguelike-skeleton/src/array-2d.js
function(func, context){
            for(var x = this.width - 1; x >= 0; x--){
                for(var y = this.height - 1; y >= 0; y--){
                    var val = this.get(x, y);
                    if(context){
                        func.call(context, val, x, y);
                    } else {
                        func(val, x, y);
                    }
                }
            }
        }
function(func, context){
            for(var x = this.width - 1; x >= 0; x--){
                for(var y = this.height - 1; y >= 0; y--){
                    var val = this.get(x, y);
                    if(context){
                        func.call(context, val, x, y);
                    } else {
                        func(val, x, y);
                    }
                }
            }
        }
function ( func , context ) { for ( var x = this . width - 1 ; x >= 0 ; x -- ) { for ( var y = this . height - 1 ; y >= 0 ; y -- ) { var val = this . get ( x , y ) ; if ( context ) { func . call ( context , val , x , y ) ; } else { func ( val , x , y ) ; } } } }
Loops over each coord value.
@method each
@param {Function} func - A function to call on each coord value. (function(value, x, y){})
@param {Object} [context] - Context to call the function with (func.call(context, val, x, y))
@return {Array2d}
Loops over each coord value .