6

I sometimes get issues while testing my project,
Like even though js function is declared, the console shows error that its not declared and some other such errors.

I use Chrome on windows while testing.

But when I use Firefox on ubuntu,these errors vanish!

Is this issue with chrome or windows ?

Comments
  • 0
    If it's declared inside a loop, declare it outside and have the loop overwrite the contents...? That's what I do in PHP, not sure it works in js
  • 0
    @daksh Its just a simple js function.
    I have imported the script with script tag.
  • 1
    JavaScript is async. sometimes different processing speeds or loading times of browsers can do this make sure the function is defined before its called. try using promise if you have time consuming tasks involved.
Add Comment