You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importEmberfrom'ember';functionshuffleArray(array){varm=array.get('length'),shuffled_n=[],shuffled_array=Ember.A();for(vari=0;i<m;i++){shuffled_n.push(i);}shuffled_n=shuffle(shuffled_n,m);// Use shuffled array of digits to randomize array object elementsfor(i=0;i<m;i++){shuffled_array.pushObject(array.objectAt(shuffled_n[i]));}returnshuffled_array;}// Shuffle array of digitsfunctionshuffle(n,m){vart,i;// While there remain elements to shufflewhile(m){// Pick a remaining elementi=Math.floor(Math.random()*m--);// And swap it with the current element.t=n[m];n[m]=n[i];n[i]=t;}returnn;}export{shuffleArray};
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: