Let\'s say I have an array like this
var myarray=[{\"id\":1234, \"listtext\":open, \"prop3\":value3 ,\"prop4\": value4}, {\"id\":1235, \"listtex
If you are using ES6 or above:
const converted = Object.assign({}, ...myArray.map(object => ({[object.id]: object})))