Created
May 2, 2016 16:00
-
-
Save cannelflow/469c2b33e3c72187156f7baf463ef5e2 to your computer and use it in GitHub Desktop.
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
type 1 | |
//app.js code | |
var app1 = require("./Component/app1.js") | |
console.log(app1); | |
//app1.js code | |
var app = "Hello From app1.js" | |
module.exports = app; | |
type 2 | |
//app.js code | |
var app1 = require("./Component/app1.js") | |
console.log(app1.app); | |
//app1.js code | |
var app = "Hello From app1.js" | |
module.exports.app = app; | |
both works fine but unlike in second case we are using app from module.exports.app = app; to app.js like console.log(app1.app); | |
we are not using app from module.exports = app; in app.js file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment