Posts by JMedeiros • 13 points
1 post
-
1
votes1
answer219
viewsQ: Typescript error: Type 'K' cannot be used to index type’T'
I’m starting with Typescript and I stalled at the time of typing the following function: const pickProp = prop => obj => obj[prop] I’m trying this way: const pickProp = <K>(prop: K)…