Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item 54: Know How to Iterate Over Objects #5

Open
danvk opened this issue Mar 1, 2022 · 4 comments
Open

Item 54: Know How to Iterate Over Objects #5

danvk opened this issue Mar 1, 2022 · 4 comments
Labels
💬 blog comments Comments on effectivetypescript.com (Utterances)

Comments

@danvk
Copy link
Owner

danvk commented Mar 1, 2022

Item 54: Know How to Iterate Over Objects

https://effectivetypescript.com/2020/05/26/iterate-objects/

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by franzkissig on 2020-11-23 03:37:

Thx for the nice article! The end is unconventional ;-)

@danvk danvk added the 💬 blog comments Comments on effectivetypescript.com (Utterances) label Mar 1, 2022
@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by danvdk on 2020-11-23 10:58:

Should be fixed now, thanks for the heads up. In case you're curious, this had to do with some annotations I added for literate-ts.

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by ProGamingTvG (progamingtvg) on 2021-06-12 10:58:

Thx man, super helpful! I had created extra types instead of using "keyof". How embarassing.
Also, I was using type assertions inside the for loop instead of using type annotations outside of the for loop. Lesson learned xD

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by Robert Konigsberg (robert_konigsberg) on 2022-02-24 12:40:

es6 map is useful, but often feels clunky, particularly as I need to test for inclusion viz. `has` or `!== undefined`. So I've started looking at iterating over objects using keyof, typeof, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 blog comments Comments on effectivetypescript.com (Utterances)
Projects
None yet
Development

No branches or pull requests

1 participant