Created
June 22, 2016 05:06
-
-
Save maxehnert/9233f8bd66082ade54d61bff3cd0b3bf to your computer and use it in GitHub Desktop.
es5 cyclic dependency add.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const subtractModule = require('./subtract.js'); | |
exports.countAdd = 0; | |
exports.add = function(n = 0) { | |
exports.countAdd++; | |
console.log('countAdd', exports.countAdd); | |
subtractModule.countSubtract++ | |
console.log('countSubtract from add file', subtractModule.countSubtract); | |
if (n < 20) return subtractModule.subtractfn(n + 1); | |
} | |
subtractModule.subtractfn(exports.countAdd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment