Object Properties in JavaScript
Level 276 keystrokes
Creates an object with properties and accesses them using dot notation.
JavaScript code
// Create an object using curly braces {}// Objects contain key-value pairs called properties1let car = { // brand is a property with string value "Toyota"2 brand: "Toyota", // year is a property with number value 20203 year: 20204};// Access properties using dot notation (object.property); prints "Toyota 2020"5console.log(car.brand, car.year);Output
Toyota 2020
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this JavaScript code and how often they appear.
.× 3,× 2;× 2:× 2"× 2(× 1)× 1{× 1}× 1=× 1