Skip to content

Instantly share code, notes, and snippets.

@deedubs
Created September 14, 2011 19:09
Show Gist options
  • Save deedubs/1217471 to your computer and use it in GitHub Desktop.
Save deedubs/1217471 to your computer and use it in GitHub Desktop.
Best use of Javascript ever!
Array.prototype.random = function() {
return this[Math.floor(Math.random() * this.length)];
}
function wave() {
var hands = ["\\", "/", "|"];
var heads = ["o", "O"];
document.title = hands.random() + heads.random() + hands.random();
};
setInterval(wave, 10);
// Seen on http://raspberry-style.net/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment