JSFiddle - React, Tailwind, and code Playground
by wwwroot
JavaScript
/* Prototype pattern */
var ViewModel = function() {
this._tax = 0.2;
};
ViewModel.prototype = {
_addTax: function (net) {
return net + net * this._tax;
},
printPrice: function (price) {
console.log(this._addTax(price));
}
}
return ViewModel;