Domenic Denicola (2014-03-14T14:40:44.000Z)
domenic at domenicdenicola.com (2014-03-21T15:04:26.621Z)
From: John Barton <johnjbarton at google.com> > What is a 'mutable binding'? ```js // module1.js export let foo = 5; export function changeFoo() { foo = 10; } // module2.js import { foo, changeFoo } from "./module1"; // Import imports mutable bindings // So calling changeFoo will change the foo in current scope (and original scope) console.log(foo); // 5 changeFoo(); console.log(foo); // 10 // module3.js module module1 from "./module1"; let { foo, changeFoo } = module1; // Destructuring uses assignment to copy over the current values // So calling changeFoo does not affect this binding for foo console.log(foo); // 5 changeFoo(); console.log(foo); // 5 ```