What is Nostr?
Axel Rauschmayer /
npub10fa…rdvy
2024-05-06 01:19:57

Axel Rauschmayer on Nostr: #TypeScript: I was perplexed why JavaScript would let me use for-of to iterate over ...

#TypeScript: I was perplexed why JavaScript would let me use for-of to iterate over the result of .querySelectorAll(), but TypeScript told me I could not do that.

Thankfully, that’s easy to fix: Simply add "DOM.Iterable" to "lib"—e.g.:

"lib": [
"es2022", "DOM", "DOM.Iterable"
],

Source: https://alanrezende.com/typescript-error-type-nodelistof-element-must-have-a-symbol-iterator-method-that-returns-an-iterator
Author Public Key
npub10faqj7xvgmhhl42glvf9u5wqfhnafjnrjst6yx6k4227xugupvuqzardvy