Write/delete operations work directly with the object. The prototype is only used for reading properties. In fact though, all environments including server-side support _proto_, so we’re quite safe using it.Īs the _proto_ notation is a bit more intuitively obvious, we use it in the examples. We’ll also cover these functions later.īy the specification, _proto_ must only be supported by browsers. It exists for historical reasons, modern JavaScript suggests that we should use Object.getPrototypeOf/tPrototypeOf functions instead that get/set the prototype. Later we’ll see situations where it matters, for now let’s just keep it in mind, as we build our understanding of JavaScript language. Please note that _proto_ is not the same as the internal ] property. It’s a common mistake of novice developers not to know the difference between these two.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |