• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in JavaScript by
Q:
How can you read properties of an Object in JavaScript?

1 Answer

0 votes
by
You can write and read properties of an object using the dot notation as follows −

// Getting object properties

emp.name  // ==> Zara

emp.age   // ==> 10

// Setting object properties

emp.name = "Daisy"  // <== Daisy

emp.age  =  20      // <== 20

Related questions

0 votes
asked Sep 19 in JavaScript by sharadyadav1986
0 votes
asked Feb 6, 2020 in JavaScript by rajeshsharma
...