Skip to content

Instantly share code, notes, and snippets.

View alex-steinberg's full-sized avatar

Alex Steinberg alex-steinberg

  • Cape Town
View GitHub Profile
@alex-steinberg
alex-steinberg / with-async-await.js
Created August 24, 2019 14:48
Async/await explanation
class Tester {
async myAsyncFn() {
const foo = await new Promise((resolve, reject) => {
console.log('foo fired async')
resolve('myAsyncFn resolved');
});
console.log('bar fired');
console.log('foo has a value: ', foo);
}
}
@alex-steinberg
alex-steinberg / 0_reuse_code.js
Created July 6, 2016 19:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console