function rotate (a, direction, amount) {
                    if(!(a instanceof Array)) return a;
                    if(direction && libs.object.isNumeric(direction) && !amount) {
                        amount    = direction;
                        direction = undefined;
                    }

                    if(!amount || (amount && !libs.object.isNumeric(amount))) amount = 1;
                    for(var i = 0; i < amount; i++) {
                        if(direction !== 'right') a.push(a.shift()); else a.unshift(a.pop());
                    }
                    return a;
                }
function rotate (a, direction, amount) {
                    if(!(a instanceof Array)) return a;
                    if(direction && libs.object.isNumeric(direction) && !amount) {
                        amount    = direction;
                        direction = undefined;
                    }

                    if(!amount || (amount && !libs.object.isNumeric(amount))) amount = 1;
                    for(var i = 0; i < amount; i++) {
                        if(direction !== 'right') a.push(a.shift()); else a.unshift(a.pop());
                    }
                    return a;
                }
function rotate ( a , direction , amount ) { if ( ! ( a instanceof Array ) ) return a ; if ( direction && libs . object . isNumeric ( direction ) && ! amount ) { amount = direction ; direction = undefined ; } if ( ! amount || ( amount && ! libs . object . isNumeric ( amount ) ) ) amount = 1 ; for ( var i = 0 ; i < amount ; i ++ ) { if ( direction !== 'right' ) a . push ( a . shift ( ) ) ; else a . unshift ( a . pop ( ) ) ; } return a ; }
Rotates the array left or right the specified number of times. If the direction is left, it will shift off the
first <em>n</em> elements and push them to the end of the array. If right, it will pop off the last <em>n</em>
items and unshift them onto the front of the array.
@param {Array} a The Array object to operate on.
@param {String=} [direction='left'] The direction to rotate array members.
@param {Number=} [amount=1] The number of elements to shift
@return {Array<*>} The current array, shifted.
@function
Rotates the array left or right the specified number of times . If the direction is left it will shift off the first <em > n< / em > elements and push them to the end of the array . If right it will pop off the last <em > n< / em > items and unshift them onto the front of the array .