S SearchRSS
< BackHome
Newest questions tagged typescript - Stack Overflow

Assign literal value to a dynamic property of given type of a generic object [duplicate]

I'm trying to write a function that assigns internal, hard-coded number to a dynamic property (that must be a number) of a generic object of an unknown shape. So far I have this: function assign5(target: T, key: K) {

View original source