I want to create dynamic JavaScript object as follows. I tried with looping the object but I failed to achieve that task.
This is the object I need:
var aposition = {
d6: 'bK',
d4: 'wP',
e4: 'wK'
};
But I got Like this
object x: "a1:"bR",b2:"bR",c6:"bP",f6:"wQ",g7:"wR",h2:"wK""
JavaScript Code
response.forEach(function (entry) {
positionLocate += entry.Coordination + ':' + '"' + entry.Piece.Code.replace(/"/g, '') + '"' + ',';
});