Created
June 19, 2021 20:49
-
-
Save whimsyniche/c60db567a1d76db1cb7faa36d1879d1d to your computer and use it in GitHub Desktop.
What is wrong with this code? LinkedIn JavaScript Assessment quiz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baz = () => "Hello, world!"; | |
export const foo = { | |
name: "Albert" | |
}; | |
export function bar(){ | |
return 42; | |
} | |
export default baz; | |
export default () => ({}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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