April Fools’ Day in JavaScript

We have JavaScript, we have also the April Fools’ Day, and that is a good opportunity to get away for the ordinary code and have some fun (I know, I know, JavaScript code by itself can sometimes give a lot of entertainment).

April Fools’ Day in JavaScript

First of all — an implementation for today:

getRandomNumber() {
    return 17; // o_O
}

Yes — JavaScript also knows some jokes 😉

And besides I’ve got some JavaScripts for jokers, namely Fool.js:

http://fooljs.com/

By the way, the download link on this website doesn’t work, but you can find it quickly after searching:

https://github.com/idiot/Fool.js/blob/fabed94601dcf833ba6c9ccd6635f3998a05163e/fool.js

Is this code implemented by Mr. T?

fool_js

Anyway the library (actually jQuery plugin) may be helpful in implementing various jokes in JS, such as hiding random items, playing annoying video, etc.

The usage is really simple:

$(document).ready(function() {
  $.fool('rick'); //  Run the Rick Astley prank
});

A small demo-joke available here 😀

And by the way the plugin itself is a cool piece of code to analyze. In the end, even making jokes can learn us something 🙂

Summary

There is no summary 🙂 Just do someone a joke 🙂

Have fun!