-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add missing curly brace. Typo fix for a module import. #240
Conversation
@@ -24,7 +24,7 @@ Just like strings, symbols can be used as keys for object properties. | |||
```ts | |||
let sym = Symbol(); | |||
|
|||
let obj = {}; | |||
let obj: any = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change it to:
let obj = {
[sym]: "value"
};
console.log(obj[sym]); // "value"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same idea actually, good call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing is that we never explained computer properties 😄
@mhegazy made me realize that if noImplicitAny is set to false then the code works fine. I've set it in my tsconfig file. This kind of mistake won't happen again. Sorry. |
Actually, we try to have the handbook examples clean for |
After you add the casts back in, 👍 |
👍 |
Then, I will reopen issue #239, because the code doesn't work unless noImplicitAny is false. |
Fixes #
import =
.