isNaN instead of typeof? Why does the code still print out numbers?


Instead of using the typeof operator, I want to try isNaN so the code skips the number and only prints out the languages.
But the code still churns out 4, do you know why?

Replace this line with your code. 

var languages = {
    english: "Hello!",
    french: "Bonjour!",
    notALanguage: 4,
    spanish: "Hola!"

// print hello in the 3 different languages
for ( var x in languages) {
    if(isNaN(x)) {


what is the value of x?

shouldn't it be



yes! thank you very much


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.