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
function testPromises() { | |
Promise.all([someAsynchronousFunction().then(() => { | |
console.log('first function finished'); | |
}), someOtherAsynchronousFunction().then(() => { | |
console.log('second finished'); | |
})]).then(() => { | |
console.timeEnd('testPromises'); | |
}) |
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
/** | |
*This function can be thought of as a 'class' to be instantiated | |
* | |
*/ | |
function User(){ | |
//private members | |
var username; | |
var password; | |
//constructor |