-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
Hi,
Just curious as to the reasoning behind Object.create
having a return value of type any
in lib.d.ts.
Wouldn't this make more sense?
create<T extends A>(o: A, properties?: PropertyDescriptorMap): T;
since the returned object is guaranteed to have the properties of o
through prototypal inheritance.
At present I'd like to create many objects (via literals) of type X
, but given that many of the properties are shared, using Object.create
makes a lot of sense. It seems a shame that I must use this at the expense of typing.
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code