title: Reassign variable in numerous modules?
body: <p>I have a variable <code>let activeNode;</code> in <code>main.js</code>. It can be changed by either keyboard input or mouse input. The functions dealing with each are modularized into their own files <code>keyboard.js</code> and <code>mouse.js</code>. activeNode is exported into these modules.</p>
  <p>Whenever the functions attempt to reassign the imported variable <code>activeNode</code>, console logs the error <code>Uncaught TypeError: Assignment to constant variable.</code></p>
  <p>I've seen other answers saying to also create and export a function <code>updateVariable(var)</code> in <code>main.js</code> and then call it in the modules to reassign <code>activeNode</code>, but I'd prefer not having to create an export and entire function just to reassign a variable.</p>
  <p>Is there any other way to accomplish cross-module reassignment of variables? (And without having to pass the variable into the module function calls, because the mouse input function calls are deeply nested in main.js and I don't want to have to tunnel a parameter through a bunch of higher level functions.)</p>