Good evenings to you all,
I have a question in this challenge using Math.floor and Math.random,
i just want to know why the code has a var that seems unrelated to the function ? Because in the challenge we need to accomplish this task:
You should have multiplied the result of Math.random by 10 to make it a number that is between zero and nine.
var randomNumberBetween0and19 = Math.floor(Math.random() * 20);
function randomWholeNum() {
// Only change code below this line
return Math.floor(Math.random()* 10);
}
I will thank you so much your kind orientation on this topic,
thank you all,
please include challenge link, and explain what variable is not related to the challenge
I think I am missing context but I do not understand what part of the code you are asking about
Dear @ILM,
Good morning
I appreciate your kind reply , I want to know why we use in this challenge, the keyword var and why we call this variable randomNumberBetween0and19;
Here is the link of the freecodecamp challenge :
Dear @lasjorg,
Good evenings,
Thank you so much for your reply, we appreciate it, we are making a track of javascript with mentees and mentors and some of the mentees had questions of this particular challenge , we appreciate your kindness in taking in count our question.
Have a Blessed evening, and thanks again,
Kind regards,
Ivonne