JavaScript Beginner Basics · 1 min read

JavaScript object basics

Start the JavaScript learning path »

❮ JavaScript Home All Tutorials ❯

How do I store keyed data in JS?

Object literals.

Example

Interactive preview available
JavaScript Example
const student = { name: 'Ada', year: 1 };
console.log(student.name);
student.year = 2;

Line-by-Line Walkthrough

JSON is the text format; objects are the in-memory structure.

Need more coins?

You do not have enough coins for this action.

Your balance: 0 coins

Share

Reactions

Loading reactions…