JSFiddle - React, Tailwind, and code Playground
JavaScript
function Outer()
{
Outer.prototype = new Extensions();
Outer.prototype.constructor = Outer;
this.Greetings = "Greetings!";
function Extensions()
{
this.Greet = function ()
{
alert(this.Greetings);
}
}
this.GetInner = function ()
{
return new Inner();
}
Inner.prototype = new Extensions();
Inner.prototype.constructor = Inner;
function Inner()
{
this.Greetings = "Take me to your leader.";
}
}
try
{
var outer = new Outer();
outer.Greet();
var inner = outer.GetInner();
inner.Greet();
}
catch (ex)
{
alert(ex);
}