VectoredArrays.js
//Created by Brian Kaho on 7/27/2017 under the MIT License.
Created by Brian Kaho on 7/27/2017 under the MIT License.
Created by Brian Kaho on 7 / 27 / 2017 under the MIT License .
function _vectorOperation(a, b, func){
    var is_scalar = typeof(b) === "number";
    if (is_scalar || a.length === b.length) {
        var c = new Array(a.length);
        for (var i = 0; i < a.length; i++) {
            c[i] = func(a[i], is_scalar ? b : b[i]);
        }
        return c;
    }
    console.error("wrong type/length in b: " + b);
}
function _vectorOperation ( a , b , func ) { var is_scalar = typeof ( b ) === "number" ; if ( is_scalar || a . length === b . length ) { var c = new Array ( a . length ) ; for ( var i = 0 ; i < a . length ; i ++ ) { c [ i ] = func ( a [ i ] , is_scalar ? b : b [ i ] ) ; } return c ; } console . error ( "wrong type/length in b: " + b ) ; }
Created by Brian Kaho on 7/27/2017 under the MIT License.
Created by Brian Kaho on 7 / 27 / 2017 under the MIT License .