Why this output is coming here , can any one explain?



I'm guessing that since you can do


I think this makes the range to 1000.

Your code here:

I actually don't know what you're trying to do, though!


Yes Ragezapper I Just wanted to know why its taking the rage from 7 to 1000 , and also if you see in the output there is skip of one number in the output eg: 8,10,12,14 ......997,999.


It seems like the test function just thoroughly tests your code with first all even numbers from 0 to 1000 than all odd numbers in that range and then with boolean values or maybe this is just the output of your function call.

Anyway it has nothing to do with your Math.random but is just seen because you added a console.log in this function which should not use a console.log there.