loading...

re: Switch is ok VIEW POST

FULL DISCUSSION
 

Your example with the object literal is overly long:

const hero = (x = "default") => ({
    "DC": "Batman",
    "Marvel" : "Wolverine",
    "default": "Spiderman"
}[x])
 

I have waited for that 😉

code of conduct - report abuse