nl_tokens: 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 .
pl_tokens: 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 ) ) ) <mask> = 1 ; for ( var i = 0 ; i < amount ; i ++ ) { if ( direction !== 'right' ) a . push ( a . shift ( ) ) ; else a . unshift ( a . pop ( ) ) ; } return a ; }