Skip to content

Instantly share code, notes, and snippets.

@callmephil
Created October 19, 2019 08:46
Show Gist options
  • Save callmephil/28cda253c079d1dbffdcaf414fd59f55 to your computer and use it in GitHub Desktop.
Save callmephil/28cda253c079d1dbffdcaf414fd59f55 to your computer and use it in GitHub Desktop.
"use strict";
const EMOJI = [
{
sentiment: "joy",
expression: {
extreme: "πŸ˜‚",
medium: "πŸ™‚",
slightly: "πŸ˜„",
neutral: "πŸ™‚"
}
},
{
sentiment: "sad",
expression: {
extreme: "πŸ˜‚",
medium: "πŸ™‚",
slightly: "πŸ˜„",
neutral: "πŸ™‚"
}
}
];
const getEmoji = (sentiment, expression) => {
return EMOJI.find(emoji => emoji.sentiment === sentiment).expression[expression];
}
console.log(getEmoji("joy", "neutral"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment