第一個(gè)a.js:var x ;exports.x = x;console.log(x)// 123第二個(gè)b.js:var a = require('./a.js');setTimeout(function () {console.log(a.x)},1000);運(yùn)行b.js,輸出undefined,這是為何?不是已經(jīng)暴露過(guò)了嗎?
node里面變量暴露的問(wèn)題
炎炎設(shè)計(jì)
2018-10-23 10:44:40