I want to create a dynamic Key Value Object in Java Script. Such as :
var resonseArray = [];
var i = 0;
for (var key in value) {
if (value.hasOwnProperty(key)) {
finalObj = { i : {'keys': key , 'values' : value['key']}}};
resonseArray.push(finalObj);
i++;
}
}
But when I console the resonseArray, it console the i as a string not the dynamic variable i value.