Skip to content

Instantly share code, notes, and snippets.

@killa-kyle
Last active January 3, 2022 20:02
Show Gist options
  • Save killa-kyle/4809b4149da650994094142795449fd4 to your computer and use it in GitHub Desktop.
Save killa-kyle/4809b4149da650994094142795449fd4 to your computer and use it in GitHub Desktop.
function saySomething(thingToSay){
const {isHelpful, isPositive, statement} = thingToSay
if(!isHelpful || !isPositive ) return `...🤐`
return `${statement} 👍`
}
const positiveStatement = {
statement: "You did a great job so far. I'm happy to help you finish.",
isHelpful: true,
isPositive: true
}
const negativeStatement = {
statement: "I don't like it and everything is terrible.",
isHelpful: false,
isPositive: false
}
saySomething(positiveStatement) // "You did a great job so far. I'm happy to help you finish."
saySomething(negativeStatement) // "..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment