JSFiddle - React, Tailwind, and code Playground
JavaScript
function dosomething(output) {
alert("Did something! " + output);
}
var MyNamespace = {
a: 0,
c: 0,
new1: function(){
this.a=5;
},
new2: function(){
this.c=6;
},
new3: function(output){
if(this.a < this.c){
dosomething(output);
}
}
}
MyNamespace.new3("first"); // Didn't do anything
MyNamespace.new1(); // Set a to 5
MyNamespace.new2(); // Set c to 6
MyNamespace.new3("second"); // Did something!