I create multiple objects and push them to the array objArr:
var objArr = [];
var obj = {};
var height = [9,8,7,3,6,5,2,4];
for (var i = 0; i < 8; i++) {
debugger;
  var mountainH = height[i];
  obj.h = mountainH;
  obj.index = i;
  objArr.push(obj);
}
for (var i = 0; i < objArr.length; i++) {
  alert(objArr[i].h);
}But as you can see, each object has the same values. Why?

 
     
    