Skip to content

Instantly share code, notes, and snippets.

View rafaelkendrik's full-sized avatar

Rafael Kendrik rafaelkendrik

View GitHub Profile
@rafaelkendrik
rafaelkendrik / event-loop.js
Last active May 7, 2018 11:43
Non-blocking, callback and pomises on Javascript's event loop.
/* X example - common non-blocking execution */
const x = 5
console.log('hello X', x)
const plusOneX = (x) => {
setTimeout(() => {
// a bad reassign e.g.:
x = x + 1