Correct way to tell typescript object's index is not undefined when mapping over keys ?
As shown in the example I am mapping over the keys of an object so if I am not wrong the value obtained should never be undefined so how do I tell typescript that without using
Is using type casting here with
as <typeof_value_here>
.Is using type casting here with
as
the correct way to do it or is there a better way to do it ?
2 Replies