DEV Community

Discussion on: From if/switch to mapped functions (a.k.a. object lookup)

Collapse
 
ddialar profile image
Dailos Rafael Díaz Lara

It doesn't exist like that right now. However it's proposed to the tc39 and this proposal is currently in Stage 1.

github.com/tc39/proposal-pattern-m...

Apparently there are several tries to implement it but I think they are simple patches until it's completely adopted.

bramstein.com/writing/pattern-matc...

Collapse
 
chesterc314 profile image
Chester Cobus

Thanks for looking into it :).