How to Print Out All the property/propert value of Object in Javascript

First Define an Object with property and then use for /in loop with console to print out

Example:
Defining Object with property
var fifa = {
    fullName: "International Federation of Association Football",
    president: "Sepp Blatter",
    motto: "For the Game. For the World",
    formation: "21 May 1904 (110 years ago)"
};
 Now print out property  using for /in loop with console

for (var property in fifa){
    console.log(property);
    }
 Now print out property value  using for /in loop with console
for (var key in fifa){
    console.log(fifa[key]);
    }

Comments

Popular posts from this blog

পিৎজা এবং বই

How to Download Video from Youtube - The Easiest way