How do I pass a value to an external variable?
Hello. Why, in this code, alert outside .then () outputs undefined value, although the variable itself is declared outside this construction.
Because this is how asynchronous operations work. Use async / await for convenience.Phoebe Vincent
To place the code, please use CodePen or similar tool. Thanks you!