【发布时间】:2021-01-03 15:55:53
【问题描述】:
我不是开发人员,我只是使用了检查元素,但我的继父从新年开始就遇到了他的网站问题。当使用检查元素并单击损坏的按钮时,会出现“TypeError:分配给常量变量。”
代码是:
/*************************** PUBLIC VIEW ******************************/
async function displayAppointmentsFromDate(date, package, addonArray) {
const appointments = await getAppointmentsFromDate(date);
let html = '';
const today = new Date();
const thisYear = today.getFullYear();
const thisMonth = today.getUTCMonth();
if(thisMonth === 0) thisMonth = 12;
const thisDay = today.getUTCDate();
const thisDate = thisYear.toString() + '-' + thisMonth.toString() + '-' + thisDay.toString();
const currentTime = today.toTimeString();
错误指向这行代码:
if(thisMonth === 0) thisMonth = 12;
如果真的需要帮助,我可以扩展代码和网站 url,谢谢!
【问题讨论】:
标签: javascript html css web