Created
March 4, 2015 15:38
-
-
Save jaw187/c7d95786a6a86b71262b to your computer and use it in GitHub Desktop.
Example of how the event loop works
This file contains 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
var test1 = function () { | |
var options = { | |
hostname: 'google.com', | |
port: 80, | |
path: '/' | |
}; | |
http.get(options, function (res) { | |
console.log('Test 1'); | |
}); | |
}; | |
var test2 = function () { | |
console.log('Test 2'); | |
}; | |
var test = function () { | |
test1(); | |
test2(); | |
}; | |
test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment