You should consider using ES6 modules instead of the old ways, because they have neater syntax, better performance, and many new APIs that are likely to be packed as the ES6 modules.
Let's have a look at the ES6 modules in detail.
Every ES6 module needs to be represented by a separate
A module can export a variable, function, class, or any other entity.
We need to use the
export statement in a module to export variables. The