Most people know that to make projects using TypeScript "strict" in terms of typing, you need to enable the "strict": true option in the tsconfig. ...
For further actions, you may consider blocking this person and/or reporting abuse
Hey @artxe2 !
I think the issue lies more in the
for...of/for...inloop, as it returns a string for akeyvariable. If you typecast it, everything will be fine πOh, I see.
I understand what issue you're talking about. But here again, the problem is not with
noUncheckedIndexedAccess, but with index signatures. If you explicitly annotate all keys, there won't be such an error. Here is the same playground but this explicit keys.In my article, I repeatedly mentioned that the index signature is a bad thing π
Agreed!
In general, as always, it depends on the situation π
Just dropping my 2 cents, the possible
undefinedproblem of the aforementioned record can be solved by an explicit cast in the value lookup, it's just that both the object and its key need to be casted.Though the case seems rather artificial, as you'd probably be using
.valuesor.entries:PHey @bwca !
Thank you for sharing your approach to solving the problem!
I believe it's challenging to assess it solely based on this small code snippet. In real projects, everything can be significantly different π₯²
Wow, hey from kottans nice to see you here :D
Hi @denys_dev βΊοΈ
Nice to see you and I'm so glad you keep learning πͺ
Thank you for the article π
Thank you for not standing still!