The Code of No-Code

May 02 2016

Unfortunately there is no simple "one liner" that will shuffle an array in javascript. All to often I see people advising to use:

sort(function() { Math.random() - 0.5 }))

However, this does not shuffle the array. First, let's take a look at what does work. It's called the Fisher-Yates shuffle and looks like this in javascript:

Mar 02 2016

Even if you have an undo option (which most email clients don't have) there is a certain point during the drafting of an email when you start to cringe at the thought of accidentally hitting send. Maybe there are some funny comments you want to keep with the main email, nsfw, or ns-for-the-recipient-list, or your just not sure who exactly is on the list and don't want to stop typing, or maybe your in a meeting and need to keep the flow. Whatever the scenario there are times when you'd like to click a button (or something) and have your client (gmail, outlook, whatever) stop you from sending that email.