JSFiddle - React, Tailwind, and code Playground

by MegaScience

JavaScript

const config = {
	debug: true
};
const dMsg = x => {
	if(config.debug) console[x.type](...x.txt);
};
const p = new Proxy(dMsg, {
	get: (target, name) => (...args) => target({type: name, txt: args})
});

p.warn(1, 2, 3);