const rooms = {r1: "Room 1", r2: "Room 2", r3: "Room 3"}; const arrayResult = Object.keys(rooms).map(room => { return {id: room, name: rooms[room]} });