devolver nombre propiedades de objeto javascript
JavaScript
nombreObjeto.nombrePropiedad
Si el método no recibe parámetros colocamos los paréntesis también, pero sin nada dentro.
miObjeto.miMetodo()//Calcular area rectangulo con objetos
//método
function rectangulo(base, altura) {
this.base = base;
this.altura = altura;
this.calcularArea = function () { return this.base * this.altura; };
}
//instanciamos el objeto rectángulo:
var r1 = new rectangulo(2, 4);
//y llamamos al método área:
console.log(r1.calcularArea());libros = ["Brideshead", "Faustus", "Musica"]
function libro(titulo, autor, ISBN) {
this.titulo = titulo;
this.autor = autor;
this.ISBN = ISBN;
//this.isbn calculo
}
var Brideshead = new libro("Retorno a Brideshead", "Evelyn Waugh", 8447308472);
var Faustus = new libro("Doctor Faustus", "Thomas Mann", 9788435018449);
var Musica = new libro("Una música constante", "Vikram Seth", 9780767904643)
console.log(Object.values(Brideshead))var coche =new Auto("Seat", "Ibiza", 90, 2010, 5000);
console.log(Object.keys(coche))
//Array(6) [ "marca", "modelo", "potencia", "antiguedad", "precio", "edadAprox" ]
Also in JavaScript:
- Title
- filter table search
- Category
- JavaScript
- Title
- document ready without jquery
- Category
- JavaScript
- Title
- how to Fetch the index of table row using jquery
- Category
- JavaScript
- Title
- how to append object in array javascript
- Category
- JavaScript
- Title
- html to jsx
- Category
- JavaScript
- Title
- iterate through array js
- Category
- JavaScript
- Title
- how to know if a number has a decimal number js
- Category
- JavaScript
- Title
- how to get the height of window in javascript
- Category
- JavaScript
- Title
- how to use hooks react
- Category
- JavaScript
- Title
- array.filter in js
- Category
- JavaScript
- Title
- expo app.json
- Category
- JavaScript
- Title
- how to load localt ext file in js
- Category
- JavaScript
- Title
- http content type json
- Category
- JavaScript
- Title
- create element javascript with class
- Category
- JavaScript
- Title
- javascript add text to textarea overwrite
- Category
- JavaScript
- Title
- geojson longitude latitude order
- Category
- JavaScript
- Title
- focus js
- Category
- JavaScript
- Title
- angular material theme colors
- Category
- JavaScript
- Title
- firestore set a document
- Category
- JavaScript
- Title
- client side redirect javascript
- Category
- JavaScript
- Title
- How to pass variables from js to html node
- Category
- JavaScript
- Title
- how to validate input type=date in javascript
- Category
- JavaScript
- Title
- how to get the last element in javascript
- Category
- JavaScript
- Title
- compare two array javascript
- Category
- JavaScript
- Title
- javascript Clone an array
- Category
- JavaScript
- Title
- how to make a deep copy in javascript
- Category
- JavaScript
- Title
- combine p5 with react
- Category
- JavaScript
- Title
- express json body
- Category
- JavaScript
- Title
- get month in two digit in javascript date
- Category
- JavaScript
- Title
- express js sample project
- Category
- JavaScript
- Title
- express get query params from url
- Category
- JavaScript
- Title
- document addeventlistener click
- Category
- JavaScript
- Title
- get current directory vbscript
- Category
- JavaScript
- Title
- error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class.
- Category
- JavaScript
- Title
- if checkbox checked jquery value 1
- Category
- JavaScript
- Title
- discord js channel count
- Category
- JavaScript
- Title
- export function javascript
- Category
- JavaScript
- Title
- html external javascript
- Category
- JavaScript
- Title
- function prototype javascript
- Category
- JavaScript
- Title
- how to update all node libraries
- Category
- JavaScript
- Title
- html parser javascript
- Category
- JavaScript
- Title
- compare string camelcase and lowercase javascript
- Category
- JavaScript
- Title
- javascript access pushed element
- Category
- JavaScript
- Title
- array.filter in javascript not working in w3schools
- Category
- JavaScript
- Title
- console log all array values node
- Category
- JavaScript
- Title
- document delete element
- Category
- JavaScript
- Title
- angular themeable components
- Category
- JavaScript
- Title
- how to gather true or false value from html checkbox in javascript
- Category
- JavaScript
- Title
- how to format unix timestamp javascript
- Category
- JavaScript
- Title
- angular sanitize vs validators
- Category
- JavaScript
- Title
- Angular add class dynamically
- Category
- JavaScript
- Title
- Alternating Sums
- Category
- JavaScript
- Title
- Angular material design
- Category
- JavaScript
- Title
- console trace js
- Category
- JavaScript
- Title
- finding an element ina na array in js
- Category
- JavaScript
- Title
- comparing arrays javascript
- Category
- JavaScript
- Title
- find max and min value in array javascript
- Category
- JavaScript
- Title
- expo open app settings
- Category
- JavaScript
- Title
- dynamodb get all items nodejs
- Category
- JavaScript
- Title
- convert object to json javascript
- Category
- JavaScript
- Title
- embed jquery
- Category
- JavaScript
- Title
- delete all the rows of table javascript
- Category
- JavaScript
- Title
- check data type in js
- Category
- JavaScript
- Title
- how to delete an element of an array in javascript
- Category
- JavaScript
- Title
- angular index of array
- Category
- JavaScript
- Title
- format date js
- Category
- JavaScript
- Title
- convert json to object jackson
- Category
- JavaScript
- Title
- get current week number javascript
- Category
- JavaScript
- Title
- javascript add class to element
- Category
- JavaScript
- Title
- es6 closures
- Category
- JavaScript
- Title
- conditional chaining chrome
- Category
- JavaScript
- Title
- component navigation without changin the url react router
- Category
- JavaScript
- Title
- if else javascript
- Category
- JavaScript
- Title
- how to get data from localstorage in javascript
- Category
- JavaScript
- Title
- angular bootstrap not working
- Category
- JavaScript
- Title
- abstraction in javascript
- Category
- JavaScript
- Title
- html inline javascript
- Category
- JavaScript
- Title
- javascript bigint
- Category
- JavaScript
- Title
- how to run different node app on server different domains
- Category
- JavaScript
- Title
- floor in js
- Category
- JavaScript
- Title
- javascript appendchild at index
- Category
- JavaScript
- Title
- collapse in angular 4
- Category
- JavaScript
- Title
- cordova capacitor document viewer fail
- Category
- JavaScript
- Title
- clear cookies js
- Category
- JavaScript
- Title
- cypress disabled
- Category
- JavaScript
- Title
- how to prevent event capturing in javascript
- Category
- JavaScript
- Title
- is sublime text a good editor
- Category
- JavaScript
- Title
- javascript button onclick programmatically
- Category
- JavaScript
- Title
- javascript array sort
- Category
- JavaScript
- Title
- how to validate date in react
- Category
- JavaScript
- Title
- how to add object to array javascript
- Category
- JavaScript
- Title
- express set response code
- Category
- JavaScript
- Title
- export aab react native
- Category
- JavaScript
- Title
- count occurrences of character in string javascript
- Category
- JavaScript
- Title
- Email validation using javascript
- Category
- JavaScript
- Title
- how to count occurrences of each character in string in javascript
- Category
- JavaScript
- Title
- install exact version npm
- Category
- JavaScript
- Title
- click doesn't work on ajax loaded data
- Category
- JavaScript
- Title
- how to add a button to react native
- Category
- JavaScript
- Title
- $.ajax javascript
- Category
- JavaScript