setProps()function

setProps(obj: T, entries: T | Partial<T> | Iterable<Prop<T>>): void
ParamType
objT
The object to set the props on (modified by reference). required
entriesT
Partial<T>
Iterable<Prop<T>>
The props to set, as an object or iterable set of key/value entry tuples. required

Set several named props on an object (by reference).

  • Keys are trusted by contract: a runtime-untrusted key like "__proto__" would mutate the target's prototype, so validate or filter untrusted keys before calling (or use a null-prototype target).