Generate Random Fractions with JavaScript

Generate Random Fractions with JavaScript
0

#1

Tell us what’s happening:

Your code so far

function randomFraction() {

  // Only changera code below this line.
 
  return math.random();
  
  }

  // Only change code above this line.

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36.

Link to the challenge:


#2

Could you let us know what the issue is so we can help?


#3

As said, you should be more specific with what the problem you are having is.

But a quick look at your code, I see the line,

  return math.random();

The Math object in JavaScript is capitalized.

There should have been a clue in the little black output window below the buttons and above the checkmarks - it should say ReferenceError: math is not defined - that’s because there is no object called “math” - it is called “Math”. Capitalization is important in JS.