Actually,I have completed the challenge right but this isn't my problem

Tell us what’s happening:
Describe your issue in detail here.
In this challenge we create a function to generate a random fraction,but when I tried to run it, it did not generate any fraction instead it printed [Function : randomFraction] Why??

   **Your code so far**

function randomFraction() {
var result = 0;ion,I have completed this challenge
 // Only change code below this line
while (result === 0){
 result = Math.random();
}
return result;
 // Only change code above this line
}
console.log(randomFraction)
   **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Challenge: Generate Random Fractions with JavaScript

Link to the challenge:

Actually, you need to call the function. In JS it’s done like this - function().
Instead of just printing it to the console like that - function

1 Like