Javascript variable export unexpected behavior – why doesn't it update across files?
I have two files here: index.js let list = []; function add() { //list.push("item"); list = ["item"]; console.log("B. list length " + list.length); } module.exports = { add, list } test.js let { add, list } = require('./index'); console.log("A. list…