Switch statements are a great way to direct application logic flow with conditional expressions. The tricky part with them though is that it’s not entirely clear when developers should use switch statements. In this video, I’m sharing my opinions on when developers should use switch through my experiences with the JavaScript feature

Igbo API GitHub: https://github.com/ijemmao/igbo_api
Volunteer Form: https://nkowaokwu.com/volunteer

Timestamp:

  • 0:00 Introduction
  • 0:33 Switch Statement Syntax
  • 1:42 When should I use Switch Statements?
  • 2:03 Example: Switch Statements used for Handling State
  • 3:12 Convert Example: Switch Statement into if/else statement
  • 4:13 Redux State using Switch Statements
  • 4:49 switch Feature: return and break keywords
  • 6:03 switch Feature: Multicases for Switch Statements
  • 6:41 Switch Statements: Big Takeaway + Advice
  • 7:28 Volunteer to the Igbo API

#javascript #programming #developer #web-development

JavaScript Switch Statements - When to use switch over if/else?
3.10 GEEK