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

459
Views
JS - Why can't the Chrome console access my global variable?

I have the following variable declared at the top level of the script:

var region = “southwest”;

When running

console.log(region)

I'm getting the following error:

VM1094:1 Uncaught ReferenceError: region is not defined at :1:13

Not sure what is causing this given the variable is global.

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

0

when you have global variables they will be assigned to window object , in your console try console.log(window.region)

about 4 years ago · Juan Pablo Isaza Report

0

Is "southwest" a string or a variable that you have assigned to the 'region' variable? If it's a string, you need to put it inside the "double quotes". And, if it is a variable, then you need to assign some value to it.

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!