I solve this challenge in edabit.com
. When I open the solution of the community I saw a recommended solution I read it but I do not understand a line
Here is the code so far:
function emotify(str) {
let [first, mid, last] = str.split(" ");
let emotify = {
"smile": ":D",
"grin": ":)",
"sad": ":(",
"mad": ":P"
}
return `Make me ${emotify[last]}`;
}
I do not understand the last line of that code:
return `Make me ${emotify[last]}`;
link to that challenge: https://edabit.com/challenge/Szh3ib2bpJCYXKrKa