Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialrory Stevens
3,840 PointsWhy would you not use switch instead of if as it is more "powerful" and better able to deal with complex situations?
Can it be done using switch instead? Why is that not the best option? Fully appreciate any help, cheers.
1 Answer
Logan Cornelius
16,876 PointsI also don't understand why not use a switch instead. Is a switch statement not more scaleable? Don't really understand why we would ever use multiple else if statements in place of a switch statement when it seems to be essentially the same thing.
Jeff McDivitt
23,970 PointsJeff McDivitt
23,970 PointsYou could but an if statement is much easier