Starlit Daily

📚 › JavaScript: make pages do things

10. Objects

Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.

An object groups related values under named keys: {name: "Nadia", marks: 88}. Read a value with a dot, as student.name, or with brackets, as student["name"].

Objects describe one thing; arrays hold many things of one kind.

Ver ejemplo

const student = {name: "Nadia", marks: 88};
console.log(student.name, student.marks);

✍️ Ahora te toca

Create an object with country set to Bangladesh and print the country.

← Volver al curso