Created
          April 25, 2017 01:24 
        
      - 
      
- 
        Save hanpama/9510f6f05c2da6a176c0ae35251d436d to your computer and use it in GitHub Desktop. 
    Understanding javascript async-await
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | (async () => { | |
| console.log(1); | |
| console.log(await 2); | |
| console.log(3); | |
| })(); | |
| (async () => { | |
| console.log('a'); | |
| console.log(await 'b'); | |
| console.log('c'); | |
| })(); | |
| console.log(4) | |
| /* | |
| 1 | |
| "a" | |
| 4 | |
| 2 | |
| 3 | |
| "b" | |
| "c" | |
| */ | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment