A module runs once
main.cjs requires the same file twice. Count how often it runs.
main.cjs
const a1 = require('./a.cjs');const a2 = require('./a.cjs');console.log('same object: ' + (a1 === a2));a.cjs 2 lines
console.log('a.cjs runs');module.exports = { name: 'a' };1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…