Skip to content

Instantly share code, notes, and snippets.

@swashata
Created February 12, 2019 08:41
Show Gist options
  • Save swashata/75e7e0a7e8398c66623b96084709bf51 to your computer and use it in GitHub Desktop.
Save swashata/75e7e0a7e8398c66623b96084709bf51 to your computer and use it in GitHub Desktop.
const scoo = 'doo';
console.log(module.exports === exports);
// Assign variable scoo to exports
exports.scoo = scoo;
// Assign variable scoo to module.exports
module.exports = scoo;
console.log(module.exports === exports );
const a = require('a');
console.log(a);
@swashata
Copy link
Author

The question is what would the output of all the console.log from both the files, if we run this command

node b.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment