tylermcginnis / javascriptvisualizer

A tool for visualizing Execution Context, Hoisting, Closures, and Scopes in JavaScript.

Home Page:https://tylermcginnis.com/javascript-visualizer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Closure code not updating vars

tylermcginnis opened this issue · comments

var count = 0

function makeAdder(x) {
  return function(y) {
    return x + y;
  };
}

var add5 = makeAdder(5);
count += add5(2)