Example Time!

Let's say we have an array of animals and we want to determine which one is the coolest:

				
					animals = ['cat', 'dog', 'tiger', 'elephant'];
					coolest_animal = switch (animals[0]) {
						case 'cat': return 'meow';
						case 'dog': return 'woof';
						case 'tiger': return 'roar';
						case 'elephant': return 'trunk';
					}
					console.log(coolest_animal);
				
			

Output: meow

For Loops: Because Who Needs to Get It Done? While Loops: Because You'll Never Get It Done