TypeError: Assignment to constant variable 如果你给const类型的变量定义了初始值,然后你在之后又想要改变其值,便会报错, const必须定义初始值,并且之后不可以修改。 解决办法:将对应的const变量修改为let,并且let可以不用赋初始值!