Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
What is wrong with this code? LinkedIn JavaScript Assessment quiz
const baz = () => "Hello, world!";
export const foo = {
name: "Albert"
};
export function bar(){
return 42;
}
export default baz;
export default () => ({});
@whimsyniche
Copy link
Author

https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#description

There are two different types of export, named and default. You can have multiple named exports per module but only one default export. Each type corresponds to one of the above syntax:

https://stackoverflow.com/questions/21117160/what-is-export-default-in-javascript
https://2ality.com/2014/09/es6-modules-final.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment