lundi 4 juillet 2016

I saw this program somewhere, what will be the output of this program and how, i can't understand the function of the line for(var prop in obj)?

var friends=
{
    bill:
         {
            firstName:"Bill",
            lastName:"Prasad",
            number:"8446644227",
            address:["maybe in","new york"]
         },
    steve:
          {
            firstName:"Steve",
            lastName:"Kumar",
            number:"8566818855",
            address:["somewhere im","los angeles"]
          }
}


    var list = function(obj) 
{
  for(var prop in obj)
     {
      console.log(prop);
    }
}




Aucun commentaire:

Enregistrer un commentaire