Skip to content

Instantly share code, notes, and snippets.

View Irandoust's full-sized avatar

Ali Irandoust Irandoust

View GitHub Profile
@Irandoust
Irandoust / 0_reuse_code.js
Last active August 29, 2015 14:26
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

Do not use forEach with async-await

TLDR: Use for...of instead of forEach in asynchronous code.

The problem

Array.prototype.forEach is not designed for asynchronous code. (It was not suitable for promises, and it is not suitable for async-await.)

For example, the following forEach loop might not do what it appears to do:

@Irandoust
Irandoust / gist:fddc578cf4b46bca62ce1bea1821b242
Created January 30, 2023 21:49 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch