JSFiddle - React, Tailwind, and code Playground

by seyenaz

JavaScript

function B() {
    this.x = 5;
    this.getX = function() {
        return this.x;
    }
}

var b = new B();
var getXFunc = b.getX;
alert(getXFunc());