Run:
node a.js
Result:
A from C {}
C from B This is C
B from A This is B
Run:
node a.js
Result:
A from C {}
C from B This is C
B from A This is B
const b = require("./b"); | |
console.log("B from A", b); | |
module.exports = "This is A"; |
const c = require("./c"); | |
console.log("C from B", c); | |
module.exports = "This is B"; |
const a = require("./a"); | |
console.log("A from C", a); | |
module.exports = "This is C"; |