values object js code example
Example 1: object values javascript
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.values(object1));
Example 2: javascript object entries
const object1 = {
a: 'somestring',
b: 42
}
Object.entries(object1)
.forEach(([key, value]) => console.log(`${key}: ${value}`))
Example 3: object values
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.values(object1));
Example 4: listar objetos javascript
libros = ["Brideshead", "Faustus", "Musica"]
function libro(titulo, autor, ISBN) {
this.titulo = titulo;
this.autor = autor;
this.ISBN = ISBN;
}
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))