JavaScript WAIT - basic examples
Example 1
WAIT Basic example - modern async/await solution
- Create variable with value 10
- Wait 5 second
- Add +10 to variable
- Display results
Example 2
WAIT in FOR lopp - modern async/await solution (ES2015+)
- Create variable with value 10
- In FOR loop wait 5 sec - 3x
- Add +10 to variable
- Display results in loop
- Modern async/await solution (ES2015+)
Example 3
WAIT in RECURENT function - solution for old browsers (ES5)
- Create variable with value 10
- In RECURENT FUNCTION wait 5 sec - 3x
- Add +10 to variable
- Display results in loop
- Solution for old browsers (ES5)