Created
November 2, 2018 14:44
-
-
Save jasonrhodes/154283bd7a525397c221b13fb8cda78e to your computer and use it in GitHub Desktop.
implicit function naming quirk?
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
// file1a.js | |
const CoolName = () => 'cool' | |
export { CoolName } | |
// file2a.js | |
import { CoolName } from './file1a' | |
console.log(CoolName.name) // -> "CoolName" | |
/** | |
* implicit function names derived from variable assignment, nice ok cool cool | |
* | |
* but wait ---------------------------------------------------------------------- | |
*/ | |
// file1b.js | |
export const CoolName = () => 'cool' | |
// file2b.js | |
import { CoolName } from './file1b' | |
console.log(CoolName.name) // -> undefined | |
/** | |
* WHYYYYYY | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment