JSFiddle - React, Tailwind, and code Playground
JavaScript
function car() {
}
car.prototype = {
update1: function(s) {
console.log("updated "+s+" with update1")
},
update1: function(s) {
console.log("updated "+s+" with update1")
},
update1: function(s) {
console.log("updated "+s+" with update1")
},
update: function(s, updateFn) {
this[updateFn]( s)
}
}
var c = new car()
c.update("tyres", 'update1')