STOP Using Switch Statements! Use These Instead...

Опубликовано: 18 July 2026
на канале: Dave Gray
27,727
1k

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

STOP Using Switch! In this tutorial we'll discuss why you should stop using switch and use a couple of other available options instead of using switch statements. This tutorial applies to both Vanilla Javascript and Node.js.

🚩 Subscribe ➜ https://bit.ly/3nGHmNn

🚀 JavaScript for Beginners: Full Course (8 hours):    • JavaScript Full Course for Beginners | Com...  

STOP Using Switch Statements! Use These Instead...

(00:00) Intro
(00:05) Welcome
(00:18) Switch Statements
(01:34) Lookup Objects (or object lookups)
(02:58) How to have a default value
(03:55) ES6 Maps
(05:40) Review
(06:14) Maps vs Objects

Reference:
MDN Maps vs Objects:
https://developer.mozilla.org/en-US/d...

✅ Follow Me:
Twitter:   / yesdavidgray  
LinkedIn:   / davidagray  
Blog: https://yesdavidgray.com
Reddit:   / daveoneleven  

Was this tutorial about avoiding switch statements and instead using object lookups or Map objects helpful? If so, please share. Let me know your thoughts in the comments.

#stop #switch #statements