for... if vs switch | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

for... if vs switch

Why doesnĀ“t the switch block work? The for.. if block works fine. They should do the same thing.. right? https://code.sololearn.com/WI3gx5HM63Op/#js

24th May 2020, 6:07 PM
Peter SvƤrd
Peter SvƤrd - avatar
2 Respostas
+ 2
You still need your for loop. It should be for(word of storyWords ){ switch (word) { ..... } }
24th May 2020, 6:14 PM
Ore
Ore - avatar
+ 1
Worked. Thank you!
24th May 2020, 7:47 PM
Peter SvƤrd
Peter SvƤrd - avatar