Q:

selecting object in data structure

How would you make an new object with just animal/weight key/value pairs from the following object? 
{
    "Pigs": {
        "Weight": 6.2,
        "Price": 1.6
    },
    "Chicken": {
        "Weight": 5.8,
        "Price": 0.9
    },
  ...

A:

Try this :
 var a={ "Pigs": { "Weight": 6.2, "Price": 1.6 }, "Chicken": { "Weight": 5.8, "Price": 0.9 }}
 var g={};

 for (var o in a)
  {
    g[o]=a[o].Weight;
  }

 console.log(g) //Object {Pigs: 6.2, Chicken: 5.8} 

