Hi guys! How can we store the result of generateTarget() in a variable, cause if using function one more time, it will generate another random number. I need to store the first generated number!Thank you!

function generateTarget() {
    return Math.floor(Math.random() * 10);

Well, one can do:

let x = 5;

That is, storing any object in a variable, and functions are objects, so what’s to stop you writing

let someVar = someFunc();

Essentially, you need to call the function, and store that function call in a variable.