JSFiddle - React, Tailwind, and code Playground
by abdennour
HTML
<div>
<p id="console"></p>
</div>
JavaScript
(function(w,nameSpacePrivate){
w.Person=function(name){
this.name=name;
return this;
};
w.Person.prototype.profilePublic=function(){
return nameSpacePrivate.profile.call(this);
};
nameSpacePrivate.profile=function(){
return 'My name is '+this.name;
};
})(window,{});
var abdennour=new Person('Abdennour');
document.getElementById('console').innerHTML=abdennour.profilePublic();