I have created 2 arrays and I want to add the variable in listOrder to each date in dataTemp based on day.
let listOrder = ['日', '月', '火', '水', '木', '金', '土'];
let dataTemp = [
{ calendar_date: '2021/11/7' },
{ calendar_date: '2021/11/8' },
{ calendar_date: '2021/11/9' },
{ calendar_date: '2021/11/10' },
{ calendar_date: '2021/11/11' },
{ calendar_date: '2021/11/12' },
{ calendar_date: '2021/11/13' },
{ calendar_date: '2021/11/14' },
{ calendar_date: '2021/11/15' },
{ calendar_date: '2021/11/16' },
{ calendar_date: '2021/11/17' },
{ calendar_date: '2021/11/18' },
{ calendar_date: '2021/11/19' },
{ calendar_date: '2021/11/20' }
];
I want to merge the 2 arrays of objects into one like the following:
let data = [
{ calendar_date: '2021/11/7 日' },
{ calendar_date: '2021/11/8 月' },
{ calendar_date: '2021/11/9 火' },
{ calendar_date: '2021/11/10 水' },
{ calendar_date: '2021/11/11 木' },
{ calendar_date: '2021/11/12 金' },
{ calendar_date: '2021/11/13 土' },
{ calendar_date: '2021/11/14 日' },
{ calendar_date: '2021/11/15 月' },
{ calendar_date: '2021/11/16 火' },
{ calendar_date: '2021/11/17 水' },
{ calendar_date: '2021/11/18 木' },
{ calendar_date: '2021/11/19 金' },
{ calendar_date: '2021/11/20 土' }
];