JSFiddle - React, Tailwind, and code Playground

by Cwalkdawg

JavaScript

var Work = function Work() {   
    this.closureVar = "hello";

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

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

var work = new Work();