so, above, you have a function. That function does, in fact, calculate a value between 1 and 10 - but it does nothing with that value. When @ieahleen asked you about the return statement, there’s a point. Every function returns a value, even if we don’t specifically say
return. If we don’t
return some value, our function still will return something - if we don’t specify, it will return
So here’s an example:
const returnedValue = 'I am a string.';
This function, when called,
returns a value. That value is a string, so we can do
const myStringyThing = myFunctionThatReturnsSomething();
// now, myStringyThing === 'I am a string.'
So, in the function I quoted at the top of this, you have a mathematical expression, but you don’t actually return the value you’ve just calculated. Can you figure how to do that?