Web Developer currently experienced in JavaScript, React, Node.js but interested to learn multiple technologies and not stick to dead ones.
Specialization- Building high performance SPAs.
Instead of switch statements we can also use objects. The keys act as cases. Now we just have to call decisionObject[case]. It also frees us from break statements
I build things with my hands. The human behind Shift - https://laravelshift.com, master of Git - https://gettinggit.com, and author of "BaseCode" - https://basecodefieldguide.com
Instead of switch statements we can also use objects. The keys act as cases. Now we just have to call decisionObject[case]. It also frees us from break statements
Completely agree for simple blocks like the examples. Just remember to use good naming.