es6

05. Modularization πŸ‘©β€πŸ«πŸ§‘β€πŸ«

badmath.js

const pie = 'apple';

const predictable = () => 1;

// module.exports is an object we use to store variables or methods
module.exports = {
  pie,
  predictable,
};

index.js

const badmath = require('./badmath.js');

console.log(badmath.pie);

console.log(badmath.predictable());