Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  
</body>
</html>
 
// noprotect
var a={
    "Company" : "ABC Company",
    "Place"   : {
                   "Bangalore" :{ 
                                    "Address" : "MG Road",  
                                    "Phone"   : ["988888","888866","365656"]
                                },
                   "Mubmai" :   { 
                                    "Address" : "1st Main Road,West",  
                                    "Phone"   : ["21212","123123","544455"]
                                }
                }
};
var t = [];
for (p in a.Place)
{
    
  var _;
  for (i=0;  i< (_=a.Place[p]["Phone"],_.length);i++)
   
    {
        var g = {
            Company: a.Company,
            Place: p,
            Address: a.Place[p]["Address"]
        };
      
        g.Phone = _[i];
        t.push(g)
    }
}
console.log(t);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers