JSFiddle - React, Tailwind, and code Playground
JavaScript
/**
* THIS IS THE STUPIDEST CURRY IN THE WORLD
* OH MY GOD WHO WROTE THIS CRAP
*/
function say(hey) {
function finalize() {
alert(say.words.join(' '));
say.words = [];
}
if (say.words.length) {
finalize();
}
return (function word(hey) {
say.words[say.words.length] = hey;
clearTimeout(say.timeout);
say.timeout = setTimeout(finalize, 10);
return word;
}(hey));
}
say.words = [];
say('How')('do')('you')('like')('that');
say('I')('like')('it')('a')('lot');