JSFiddle - React, Tailwind, and code Playground

by Cwalkdawg

JavaScript

var Work = function Work() {};

Work.prototype = {
    closureVar: "hello",
    innerOnSuccess: function () {
        console.log("Inner call:" + this.closureVar);
    },
    someCall: function () {
        outerOnSuccess(this);
        this.innerOnSuccess();
    }
};

var outerOnSuccess = function (context) {
    console.log("Outer call:" + context.closureVar);
};

var work = new Work();

work.someCall();