27/30 the other way


I used not if - else, but other way, is it correct?
for (var x in languages) {
switch(typeof languages[x] ){
case 'string':


But it is working, why it is wrong to use it?


I thought that the course don't accept your code.
I tried it and 27/30 accepts your code then no problem, you can use it freely.