Skip to content

Instantly share code, notes, and snippets.

@whimsyniche
Created June 19, 2021 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whimsyniche/c60db567a1d76db1cb7faa36d1879d1d to your computer and use it in GitHub Desktop.
Save whimsyniche/c60db567a1d76db1cb7faa36d1879d1d to your computer and use it in GitHub Desktop.
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