Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     

How do I access properties of a javascript object if I do not know the names

For example we have object like blow:

var data = { Name: 'rohit', Value: '0' };

Properties can be accessed by the property name like below



Now we want to view all properties of Object, then we will write

for (var key in data) { 

or same can be achieve with below function:

for each (var value in data) {
Share this article   |    Print    |    Article read by 3258 times
Rohit kakria
I am software developer
Related Articles: No related article
Related Interview Questions: No related interview question