JSFiddle - React, Tailwind, and code Playground

by Kevin Faulhaber

JavaScript

(function () {
    var fn = function (callback) {
        setTimeout(function () {
            var res = prompt('Hey nigga how old are you?');
            callback(res);
        }, 0);
    };

    //exporting
    window.fn = fn;
})();


fn(function (res) {
    if (!isNaN(res) ){
        alert('You are ' + res + ' years old');
    } else {
        alert('Nigga, yo mom ever tell you what a number is?');
    }
});