Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert object to array

const rooms = {r1: "Room 1", r2: "Room 2", r3: "Room 3"};

const arrayResult = Object.keys(rooms).map(room => {
    return {id: room, name: rooms[room]} 
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #object #array
ADD COMMENT
Topic
Name
1+5 =