Javascript If Else 语句与数学 Floor 和数学随机数不工作
Javascript If Else Statement with mathFoor and mathRandom not working
你好,我的代码有一些问题,如果有人能帮助我,我对此还很陌生。谢谢。
var a = 5;
var b = 6;
var c = 7;
document.write(Math.floor((Math.random() * 3) + 5));
if (5) {
alert("mission failed we will get them next time");
} else {
alert("sorry");
}
请从学习文档入手=> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else
let RandomVal = Math.floor((Math.random() * 3) + 5);
console.log(RandomVal);
if (RandomVal===5) {
console.log("mission failed we will get them next time");
} else {
console.log("sorry");
}
你好,我的代码有一些问题,如果有人能帮助我,我对此还很陌生。谢谢。
var a = 5;
var b = 6;
var c = 7;
document.write(Math.floor((Math.random() * 3) + 5));
if (5) {
alert("mission failed we will get them next time");
} else {
alert("sorry");
}
请从学习文档入手=> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else
let RandomVal = Math.floor((Math.random() * 3) + 5);
console.log(RandomVal);
if (RandomVal===5) {
console.log("mission failed we will get them next time");
} else {
console.log("sorry");
}