-1
我试图随机选择一个选项使用Math.random()
这是我到目前为止的代码。如果语句原因:未捕获SyntaxError:意外的令牌<
function randChoice() {
\t var chance = Math.floor(Math.random() * 100);
if (chance > -1 && < 50) {
console.log("Option 1"); // 1
} else if (crateId > 49 && < 71) {
console.log("Option 2"); // 2
} else if (crateId > 70 && < 91) {
console.log("Option 3"); // 3
}
}
当我运行它,我得到一个错误说Uncaught SyntaxError: Unexpected token <
。
我的语法有什么问题?我一直在寻找至少一个小时,但我找不到任何有助于解决问题的迹象。
哇,谢谢!我完全错过了! – Marbles