Originally Posted by Philip M
Yes, but that is somewhat specialised. My customers have never asked for card games on their sites. But if they did I feel that the code I posted in post #7 would work just fine.
sure, it was a close to the matter example. with my array methods, i am used to getting new copies of everything, and i sometime even forget about side-effects.
just to be complete, we all should note that you can use any mutative method to get a new array with just 8 extra chars: myArray.slice()
.shuffle(). that works for shuffle(), reverse(), pop(), anything. in that light, it makes sense to include only the mutative versions, since it's a pain to make a transformer a mutator (using .push.apply), but it's easy to clone just in time so as to turn a mutator into a transformer.
BROWSER STATS [% share]
(2013/12/12) IE7:0.3, IE8:7.5, IE11:4.3, IE9:4.6, IE10:7.8, FF:18, CH:43, SF:5.5, MOBILE:21.5