function pair(arr, fn) {
                var res = [];
                for (var i = 1; i < arr.length; i++) {
                    res.push(fn(arr[i], arr[i - 1]));
                }
                return res;
            }
// the consecutive pairs of items in the source array
the consecutive pairs of items in the source array
the consecutive pairs of items in the source array
function pair(arr, fn) {
                var res = [];
                for (var i = 1; i < arr.length; i++) {
                    res.push(fn(arr[i], arr[i - 1]));
                }
                return res;
            }
function pair ( arr , fn ) { var res = [ ] ; for ( var i = 1 ; i < arr . length ; i ++ ) { res . push ( fn ( arr [ i ] , arr [ i - 1 ] ) ) ; } return res ; }
the consecutive pairs of items in the source array
the consecutive pairs of items in the source array