While it is possible to modify the Object prototype, it is generally considered bad practice because most objects in JavaScript will inherit methods and properties from the Object prototype and they may not expect the prototype to be modified.
Aunque esto sea posible se considera una mala práctica modificar el prototipo de Object ya que la mayoría de los objetos en Javascript heredan los métodos y propiedades del objeto prototype, objetos los cuales pueden esperar que estos no hayan sido modificados.
Otros resultados
Inheritance All objects in JavaScript inherit from at least one other object.
Because an object has a single associated prototype, JavaScript cannot dynamically inherit from more than one prototype chain.
Debido a que un objeto tiene un solo prototipo asociado, JavaScript no puede heredar dinámicamente de mas de una cadena de prototipos.
How do we create an object in JavaScript that inherits from another object?
¿Cómo creamos un objeto en JavaScript que hereda de otro objeto?
Object prototypes Prototypes are the mechanism by which JavaScript objects inherit features from one another, and they work differently to inheritance mechanisms in classical object-oriented programming languages.
Los prototipos son el mecanismo por el cual los objetos en JavaScript heredan características entre si, y funcionan de manera distinta a los mecanismos de herencia de los lenguajes de programación orientada a objetos clásicos.
The JavaScript Function class inherits from the Object class (this demonstrates specialization of the model) and the Function.prototype property is an instance of Object (this demonstrates composition).
La clase Function de JavaScript hereda de la clase de Object (esto demuestra la especialización del modelo) y la propiedad Function.prototype es un ejemplo de Objeto (esto demuestra la composición)
Some believe that those who protect nature will inherit the earth eventually.
Algunos creen que quienes protegen la naturaleza heredarán la tierra eventualmente.
After conception, genes are laid that the child will inherit.
Después de la concepción, se establecen los genes que heredará el niño.
I'm sure JavaScript will have an important place in the future.
Estoy seguro que JavaScript va a tener un importante lugar en el futuro.
After I die, my daughter will inherit almost everything.
Después de mi muerte, mi hija va a heredar casi todo.
Blessedly which use no force; since they will inherit the country.
Felizmente que no usan ningún poder; como ellos heredarán el país.
Projects and programmes will inherit the priority of the objectives they fulfil.
Proyectos y programas heredarán la prioridad de los objetivos que se cumplan.
Kill your own mother when You know what you will inherit anyway.
Matar a tu propia madre cuando sabes que heredarás de todos modos.
Contenido potencialmente sensible o inapropiado
Los ejemplos se utilizan solo para ayudarte a traducir la palabra o expresión en diversos contextos. Nosotros no los seleccionamos ni los validamos y pueden contener términos o ideas inapropiados. Infórmanos sobre este tipo de ejemplos para que sean editados o dejen de mostrarse. Las traduccciones potencialmente sensibles, inapropiadas o coloquiales suelen estar marcadas con rojo o con naranja.