FreeCodeCampChina / freecodecamp.cn

FCC China open source codebase and curriculum. Learn to code and help nonprofits.

Home Page:https://fcc.asia/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

这个是BUG吗

ra1ph-L opened this issue · comments

commented

// 举例
function ourFunction(ourMin, ourMax) {

return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourFunction(1, 9);

// 请把你的代码写在这条注释以下

function randomRange(myMin, myMax) {

return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin; // 请修改这一行

}

// 你可以修改这一行来测试你的代码
var myRandom = randomRange(5, 5.5);

commented

这样写也能通过