src/transformer.js
function mapCOW(arr, func) {
    var res = null;

    for(var i=0; i<arr.length; i++) {
        var item = func(arr[i]);

        if(item !== arr[i]) {
            if(!res) {
                res = arr.slice();
            }

            res[i] = item;
        }
    }

    return res || arr;
}
function mapCOW(arr, func) {
    var res = null;

    for(var i=0; i<arr.length; i++) {
        var item = func(arr[i]);

        if(item !== arr[i]) {
            if(!res) {
                res = arr.slice();
            }

            res[i] = item;
        }
    }

    return res || arr;
}
function mapCOW ( arr , func ) { var res = null ; for ( var i = 0 ; i < arr . length ; i ++ ) { var item = func ( arr [ i ] ) ; if ( item !== arr [ i ] ) { if ( ! res ) { res = arr . slice ( ) ; } res [ i ] = item ; } } return res || arr ; }
copy-on-write version of map
copy - on - write version of map