JSFiddle - React, Tailwind, and code Playground
JavaScript
function Person(name, age){
this.name = name;
this.age = age;
}
Person.foo3 = function() {return 10;};
Person.prototype.foo = function(){
return Person.foo3();
}
Person.prototype.foo2 = function(){
return Person.foo3()*2;
}
var wong2 = new Person("wong2", "20");
alert("" + wong2.foo() + ", " + wong2.foo2()); //works
alert("" + Person.foo3()); //works. this is the distinction between what I'm loosely calling static and private
alert(foo3()); //doesnt work
alert(wong2.foo3()); //doesnt work