JSFiddle - React, Tailwind, and code Playground

by tnajdek

JavaScript

(function() {
    function foo(x) {
        var baz = 3;
        return function (y) {
        console.log(x + y + (++baz));
        }
    }
var moo = foo(2); // moo is now a closure.
moo(1);
moo(1);
})();