In JavaScript methods are regular function objects bound to an object as a property, which means you can invoke methods "out of the context".
En JavaScript los métodos son objetos como lo es una función normal y se vinculan a un objeto como lo hace una propiedad, lo que significa que se pueden invocar desde "fuera de su contexto".
This chapter assumes that you are already somewhat familiar with JavaScript and that you have used JavaScript functions to create simple objects.
Note that JavaScript functions are themselves objects - like everything else in JavaScript - and you can add or change properties on them just like we've seen earlier in the Objects section.
Observa que las funciones JavaScript son objetos en sí mismos y puedes agregarles o cambiarles sus propiedades igual que a los objetos que hemos visto en la sección Objetos.
Note: In JavaScript functions themselves are objects, so, in that context, a method is actually an {{glossary("object reference")}} to a function.
Nota: en JavaScript las funciones en si son objetos, así que, en ese contexto, un método es de hecho un {{glossary("Object Reference", "objeto de referencia")}} a una función. Aprender más
In JavaScript, functions are also objects, which means they can contain properties.
En JavaScript, las funciones también son objetos, lo que significa que puede contener propiedades.
We write a JavaScript function to create a "map" object.
See the Function object in the JavaScript reference for more information.
Véase el objeto Function en la referencia JavaScript para más información.
See the prototype property of the Function object in the JavaScript reference for more information.
Para más información, ver la propiedad prototype del objeto Function en la Referencia de JavaScript.
Once you have the object, you can operate on it using standard DOM JavaScript functions.
Una vez que tengas el objeto, podrás trabajar con él utilizando funciones estándar DOM JavaScript.
We write a JavaScript function to create a "map" object.
Incluimos el código JavaScript del API de Google Escribimos una función JavaScript para crear un objeto de mapa.
This means that JavaScript functions are just a special type of object that can do all the things that regular objects can do.
Esto significa que las funciones son simplemente un tipo de objeto especial, con las cuales se pueden hacer las mismas cosas que cualquier otro objeto podría hacer.
The second part of the code builds a string of the form fields for that object so that we can insert them into the javascript function that will add them to the form when a link is clicked.
La segunda parte del código construye una cadena de los campos del formulario de ese objeto para poder insertarlos en la función JavaScript que los añade al formulario cuando se hace clic en dicho enlace.
Conținut posibil inadecvat
Exemplele au rolul de a te ajuta să traduci cuvinte sau expresii corect si adaptat la context. Nu sunt selectate sau validate manual, așadar pot conține termeni inadecvați. Te rugăm să raportezi exemplele pe care le consideri inadecvate. Traducerile vulgare sau colocviale sunt în general marcate cu roșu sau cu portocaliu.
Înregistrează-te pentru a accesa mai multe exemple