我不想在 js 文件中包含数据数组,而是想从外部文件中读取“对象数据”。
const object1 = {
Day_1:89,
Day_2:80,
Day_3:78,
Day_4:83,
Day_5:89,
Day_6:89,
Day_7:80,
Day_8:78,
Day_9:78,
Day10:83,
Day11:89,
Day12:80,
Day13:78,
Day14:83
};
for (const [key, value] of Object.entries(object1)) {
console.log(`${key}: ${value}`);
}