JSFiddle - React, Tailwind, and code Playground
JavaScript
var self = this;
this.x = function(msg){
console.log(msg);
}
this.y = function(msg){
console.log(msg);
}
var obj = {x:"i am x", y:"i am y"}
var all = function(){
$.each(obj,function(key,value){
self[key](value);
})
}
all();