JSFiddle - React, Tailwind, and code Playground
by amir_ch
JavaScript
function AdInfo(id, name) {
this.ID = id;
this.Name = name;
this.Status = "";
};
// regular method
AdInfo.prototype.setStatus = function(status) {
this.Status = status;
}
// class level properties and methods
AdInfo.MAX_SIZE = 10*1024;
AdInfo.getUniqueName = function() {
return "ad" + Math.random();
}
var ad = new AdInfo(12345, AdInfo.getUniqueName());
alert(ad.Name);