Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Typeof operator returning undefined for everything but 'strings'

I'm currently learning about the "typeof" operator in JavaScript, but the tutorial I'm following gives me different results than what I'm seeing in my console. Using anything other than 'strings' returns undefined. There are a few things I've seen about Automatic Semicolon Insertion, but they seem a bit more complicated than my current issue. Sorry, this might sound silly to the veterans, but for some reason I can't find the answer to the problem.

VS Code Screen Shot

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you are evaluating code in two different contexts: your module, where your variables exists with a value and in the console where they are undefined, hence the result you see. You can add to typeof in your script directly to see the correct result.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!