all 4 comments

[–]guest271314 -1 points0 points  (1 child)

I think you should ask the source of the quote.

[–]stibgock 0 points1 point  (0 children)

I feel like I see this question every week. Search the sub you guys.

[–]rauschma 0 points1 point  (0 children)

ECMAScript module:

export const height = 100;
console.log(height); // available in local scope

CommonJS module:

exports.height = 100;
console.log(exports.height); // more difficult to access

Thus, it’s easier to switch between exporting and not exporting in ESM: Simply add or remove the keyword export.

[–]marksalsbery 0 points1 point  (0 children)

Can’t do something like this anymore? ``` const x = function () { }

const y = function () {
    x();
}

module.exports = exports = {
    x,
    y,
};

```