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

176
Views
Const variable issue in function in Safari

I was investigating one problem where content of web page is not getting loaded in Safari, on further investigation it was found that it is because of variable scope (const vs var).

if (1 == 1) {
  const a = 1;

  function f() {
    console.log(a);
  }
  f();
}

Error:

Can't find variable: a

With variable type as const was getting error in Safari browser and all browser in Iphone, And it was working in all other browser except Safari on desktop.

After changing it to var it has solved the issue. But still not able to find the justification why with const it was not working in Safari.

What is correct behaviour for const?

about 4 years ago · Santiago Trujillo
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!