re: How can I read a local JSON file in HTML/JavaScript? VIEW POST

re: You could assign it to a variable outside the scope of the promise. However, you can't be sure if the value is available in the variable when you a...

Could I, theoretically, have a while loop running until the variable is not null? Or is it just a matter of either it works or it doesn't?
Thanks for your help thus far, I really appreciate it!

Of course, you can. But I wouldn't recommend it. It is only good enough to be known that it is possible that way but not enough to use it in practice. You can perhaps leverage async/await to write a somewhat synchronous looking code.

code of conduct - report abuse