Generate Random Fractions console returns "function random { [native code] }"

Generate Random Fractions console returns "function random { [native code] }"
0

#1

I’ve seen some responses to this challenge similar to mine that have apparently worked.

however mine keeps returning this on the console:

function random {
[native code]
}

I can’t find anything about this response, and why it’s not working.

Your code so far

function randomFraction() {

  // Only change code below this line.
var rnd = Math.random;
  return rnd;

  // Only change code above this line.
}

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4.

Link to the challenge:


#2

Your code is returning the Math.random function itself, not the result of calling that function. You should call it by attaching a pair of parentheses:

var rnd = Math.random();

#3

Oh, will do! it’s strange that the whole setup for the problem didn’t mention that the syntax needs the parentheses in order to correctly call it. Oh well, Thanks!


#4

never mind that last post. it absolutely shows the parentheses. I’m just blind apparently. Thanks again!