因此,我有一个变量expireint,该变量已在以前的函数中使用,并且值为20200210。在新功能中,我尝试通过adding 300编辑此变量。输入正确的值。我目前的代码是:expireint + = 300;当我调试它时,我的expireint变量等于20200402为什么加上192而不是300?
var expireint; // declared globally
expireint = 20200210 //This isn't how it's created but it's how it ends up
if(code == "13HG65"){ // if code = 3 months
expireint += 0300;
很奇怪。
我的测试:
var expireint = 20200210;
expireint += 300;
document.write(expireint);
对我来说,执行此操作(在html标记中)将20200510
写入文档。