KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How does the performance of instanceof fair for "huge libraries"? Does it travel up the prototype chain one by one , similar to this? : //.. var _ = john.constructor; while (true) { if (_ === Human) { return true; } _ = _.prototype.constructor } return false; //.. Is instanceof relatively unperfomant then, compared to storing a unique interface id number in the property of every object.
Tags (comma-separated)
Save Edits
Cancel