JSFiddle - React, Tailwind, and code Playground
JavaScript
var key = AIzaSyDnfDWLVgmQw_VBp1b6XMp-ZNZDkaxVTKw;
var Person = (function() {
var store = {}, guid = 0;
function Person (key) {
this.__guid = ++guid;
store[guid] = {
fName: key
};
}
Person.prototype.fullName = function() {
var privates = store[this.__guid];
return privates.fName;
};
Person.prototype.destroy = function() {
delete store[this.__guid];
};
return Person;
})();
var myPerson = new Person();
alert(myPerson.fullName());
// in the end, destroy the instance to avoid a memory leak
myPerson.destroy();