setProp()function
setProp(obj: T, key: K, value: T[K]): T[K]
| Param | Type | |
|---|---|---|
obj | T | The object to set the prop on (modified by reference). required |
key | K | The key of the prop to set. required |
value | T[K] | The value of the prop to set. required |
| Return | |
|---|---|
T[K] | The value that was set. |
Set a single named prop on an object (by reference) and return its value.
Examples
setProp(obj, "a", 1); // 1