Let's let the code do the talking:
function flavour(name) {
switch(name) {
case 'berry':
return 1
case 'choc'
return 2
}
}
const sprinkles = true;
const iceCream = {
// Regular ol' property
milk: 2,
// Insert key and Value at the same time
sprinkles,
// 🤔 Why not do the same as above with return values
flavour('choc'), // ⬅️
// Define a value
scoop(cone) {
return cone.add(this);
}
}