JSFiddle - React, Tailwind, and code Playground

by alexdickson

JavaScript

function main() {
    this.a;
    this.set = function() {
        this.a = 1;
    }
}

var l = new main();

alert("Initial value of a is " + l.a);
l.set();
alert("after calling set() value of a is   " + l.a);