← CodePrimer
JavaScript
Beginner
Basics
JavaScript object basics
How do I store keyed data in JS?
Object literals.
const student = { name: 'Ada', year: 1 };
console.log(student.name);
student.year = 2;
Notes
JSON is the text format; objects are the in-memory structure.
Keywords: object · key · value · literal
Related
HTML
HTML headings h1–h6
How do I create page headings?
CSS
Three ways to apply CSS
What are inline, internal, and external CSS?
JavaScript
document.getElementById
How do I select one element by id?
PHP
Embed PHP inside HTML
How do I mix PHP and HTML?
HTML
Paragraphs and line breaks
How do I break text into paragraphs?
CSS
CSS box model
Why is my element wider than expected?