JSFiddle - React, Tailwind, and code Playground
JavaScript
if (!com) var com = {};
if (!com.foobar) com.foobar = {};
com.foobar.Foo = function() {
this.foo = 'foo'
this.bar = 'bar'
}
com.foobar.Foo.prototype.baz = function() {
return true
}
var myFoo = new com.foobar.Foo();
alert(myFoo.foo);
alert(myFoo.bar);
alert(myFoo.baz());