1 Replies - 408 Views - Last Post: 23 June 2018 - 07:12 AM

#1 NullNitroCodec   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-June 18

Math.Random with Console.log bug maybe...

Posted 23 June 2018 - 06:24 AM

Ok Im going to be honest I figured out my problem, I was just wondering if anyone has any idea why this big I am about to explain happens.

Ok so...
I'm trying to display random number using
math.random();
inside
console.log();

its looks like this:

console.log(Math.random() * 100);


Here is my question. The code above works but when put like shown below it returns with an error.

console.log(math.random() * 100);



Why is it that this code only works when the 'M' at the beginning of Math is a Capital letter.

Take into considerations that I am writing this code on CodeAcademy's Website IDE. I realize this could be the source of my problem, thank you for any reply.

NullNitroCodec

Is This A Good Question/Topic? 0
  • +

Replies To: Math.Random with Console.log bug maybe...

#2 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 895
  • View blog
  • Posts: 3,602
  • Joined: 13-June 14

Re: Math.Random with Console.log bug maybe...

Posted 23 June 2018 - 07:12 AM

View PostNullNitroCodec, on 23 June 2018 - 02:24 PM, said:

Why is it that this code only works when the 'M' at the beginning of Math is a Capital letter.


Because the language is case sensitive. Programming languages in general use today tend to be that way.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1