在满足我的条件时不使用验证

Validation is not used while my conditions are met.

本文关键字:验证 满足 我的 条件      更新时间:2023-09-26

这是我的代码:

function getTable(strExp){
this.strExp = strExp;
console.log(strExp);
var strTBL = "";
if (strExp === "Res"){
    for (var it = 0; it > 3; it++){
    strTBL = strTBL + jsonData.Table.ResTBL[it];
    console.log("Im in");
    }
}
else if (valeur === "Dice"){
}
return strTBL;
}

在我的脚本中,我调用:document.getElementById("ResTBL").innerHTML=getTable("Res")

当我看到控制台日志时,我看不到"我在日志中",但它给了我strExp的值。

只需将it < 3放入循环中

for (var it = 0; it < 3; it++) {
    strTBL = strTBL + jsonData.Table.ResTBL[it];
    console.log("Im in");
}