JavaScriptArray旋转()
nn-length < n < length) :
Array.prototype.rotateRight = function( n ) {
this.unshift( this.splice( n, this.length ) )}var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];months.rotate( new Date().getMonth() )
Array.prototype.rotateRight = function( n ) {
this.unshift.apply( this, this.splice( n, this.length ) )
return this;}慕桂英546537
相关分类