Skip to content

Instantly share code, notes, and snippets.

View dima1034's full-sized avatar
🎯
Focusing

Dmytro Ostapenko dima1034

🎯
Focusing
  • semicolon; vytvir
  • Lviv, Ukraine
  • 09:17 (UTC +03:00)
View GitHub Profile

This describes the common mistake with using closures in JavaScript.

A function defines a new environment

Consider:

function makeCounter()
{
  var obj = {counter: 0};
@dima1034
dima1034 / cloudSettings
Last active February 9, 2018 11:44
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-02-09T11:44:19.004Z","extensionVersion":"v2.8.7"}