JSFiddle - React, Tailwind, and code Playground

by Pointy

JavaScript

function a() {
    var d = {
      foo : "text"
    };
    for(var b in c) {
      if(c.hasOwnProperty(b)) {
        d[b] = function(b) {
            return function() { return c[b].apply(this, arguments); };
        }(b);
      }
    }
    return d;
  }

  var c = {
    a : function() { alert(this.foo); },
    b : function() { return this.a(); }
  }

  a().a(); // nothing happens