Accessing Object Properties in Javascript


Access properties of an object using dot notation or bracket notation.

Source Code

let person = {name: "John", age: 30};
console.log(person.name); // "John"
console.log(person['age']); // 30
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments