JSFiddle - React, Tailwind, and code Playground
by Paco86
JavaScript
function test(val) {
console.log(val);
}
const withDelay = delay(test);
function delay(fn) {
console.log(arguments[0]);
return fn;
/* return () => {
setTimeout(() => {
fn.apply();
}, 2000);
}; */
}
withDelay('ahahahahahahahaahha');