Skip to content

Instantly share code, notes, and snippets.

Avatar

Joe Wemyss JavaTheNutt

View GitHub Profile
@JavaTheNutt
JavaTheNutt / testing_async.js
Created Sep 12, 2017
Testing async/await blocking
View testing_async.js
function testPromises() {
Promise.all([someAsynchronousFunction().then(() => {
console.log('first function finished');
}), someOtherAsynchronousFunction().then(() => {
console.log('second finished');
})]).then(() => {
console.timeEnd('testPromises');
})
@JavaTheNutt
JavaTheNutt / Closures.js
Created Nov 16, 2016
This is an example of how to use closures for a module pattern in JavaScript
View Closures.js
/**
*This function can be thought of as a 'class' to be instantiated
*
*/
function User(){
//private members
var username;
var password;
//constructor
You can’t perform that action at this time.