I have the following object
calendarLists = [
{Title: titel1, Color:blue, number:1}
{Title: titel2, Color:green, number:2}]
{Title: titel3, Color
Your calendarLists has syntax error. You can map this array and filter wanted properties.
calendarLists = [{
Title: 'titel1',
Color: 'blue',
number: 1
},
{
Title: 'titel2',
Color: 'green',
number: 2
},
{
Title: 'titel3',
Color: 'red',
number: 3
}
];
result = calendarLists.map(
calendarList => {
return {
Title: calendarList.Title,
number: calendarList.number
}
}
);
console.log(result);