# Module System
## What's module?
## The old ways - Others For front-end side, there was no proper implementation of module system. Imagine the code, when the tiny pieces were in the file with nothing connecting them. Or code, which is 10000 line in 1 big file.
## The new way - Module system The ES6 provides keywords `export` and `import` to work with modules
## Default export Default export provides us with an opportunity to export something that can be imported anywhere with any name whenever the file is required.
## Prepare yourself for a pivotal moment in the history of web development.
## How about you In contrast to JS, humans can do multiple tasks. And that's really annoying to see someone or something to one task at a time.
## Can you suggest any other solution?
## So this is how it's done. With better terminology, of course.
## Most important differences? At their most basic, promises are a bit like event listeners except: * A promise can only succeed or fail once. It cannot succeed or fail twice, neither can it switch from success to failure or vice versa. * If a promise has succeeded or failed and you later add a success/failure callback, the correct callback will be called, even though the event took place earlier.
## There are 4 states for promises A promise can be: * fulfilled - The action relating to the promise succeeded * rejected - The action relating to the promise failed * pending - Hasn't fulfilled or rejected yet * settled - Has fulfilled or rejected
## One more term The spec also uses the term `thenable` to describe an object that is promise-like, in that it has a then method. The meaning of this one will be obvious once we get to writing code.
## Test your worthiness What do you think the output order will be like. P.S. Here as another good example of non-deterministic code. People asked this to me during interviews for 3 - 4 times.