before i answer your question, you should know the lessons regarding import/export will only be useful to you and more comprehensible, once you actually create a project wich consists of number of files and you need to import/export your code.
The default export, which is also used as a fallback, is what you will import from the file, if you dont point to a specific variable of its exported ones. For example i can create a file which consists of an apple object, a banana object and peach object and i make those objects available for import(export them) and also define a default export object called “fruit”. Whenever i wanna import one of the objects i can say “import the banana object” or “import the apple object” and gain access to it, from another file. But if i dont have a specific object in mind, i can just say “import whats in the fruits file” and ill get access to the default export, which is the “fruit” object. Ofc, the slang i used will be replaced with the proper codding syntax.
fruits.js:
let apple={
color: 'red',
taste: 'sweet'
}
let banana={ ... }
let peach={ ... }
const fruit={
'list of fruits': [apple, banana, preach]
}
export apple
export default fruit
anotherFile.js:
import {apple} from './fruits.js'
import defaultFruit from './fruits.js'
console.log(apple) /* { color: "red", taste: "sweet" } */
console.log(defaultFruit) /* { 'list of fruits': [appleObj, bananaObj...] } */