Last active
August 25, 2015 21:37
-
-
Save fliptopbox/ed8b515d39ef846041dd to your computer and use it in GitHub Desktop.
Revisions
-
fliptopbox renamed this gist
Aug 25, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
fliptopbox revised this gist
Aug 25, 2015 . No changes.There are no files selected for viewing
-
fliptopbox created this gist
Aug 25, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ Array.prototype.shuffleAndClip = function (len) { var array = this; if(len && array.length && len > array.length - 1) { len = null; } for(var rnd, value, i = array.length; i; rnd = Math.floor(Math.random() * i), value = array[--i], array[i] = array[rnd], array[rnd] = value); return len ? array.slice(0, len) : array; }