[Solved] How can I restructure a JS object?


You can use reduce –

var newData = oData.data.d.results.reduce(function(prev,curr){
    if (!prev[curr.Room]) { // if room not already in the object add it.
        prev[curr.Room] = [];
    }
    prev[curr.Room].push(curr); 
    return prev;
}, {}); // init with an empty object

console.log(newData);

solved How can I restructure a JS object?