Skip to content

Instantly share code, notes, and snippets.

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(() => {
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;