JSFiddle - React, Tailwind, and code Playground
by LyndseyB
Babel + JSX
let responses = {
negative: [
"You can't tell me what to do, #NAME",
"#NAME YOU'RE NOT MY REAL DAD!",
"No",
"Nope, #NAME, No",
"Fuck you, I won't do what you tell me",
"I'd rather you wrapped your gums around my plums"
],
greeting: [
"Hi!",
"Hello",
"S'up bitches!",
"Hoi",
"OHAI!!!",
"What's happening, #NAME?",
"o/",
"\o/"
]
};
const getResponse = (category, screenName) => {
let cat = responses[category];
return cat[Math.floor(Math.random() * cat.length)].replace('#NAME', screenName);
};
console.log(getResponse('negative', 'Lyndsey'));