Ask coding questions

← Back to all posts
console.log not printring out the answer to my math.atan
h
AlmightyDeaks (5)

expected

it to print the math.atan answer to the console

result

nothing appears in the log

location

the problem is in script.js line 42

Answered by Coder100 (18934) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18934)

Capitalize Math, it has to look like this:

console.log(Math.atan(...));

all math functions are part of the Math object, not exactly sure why (it isn't even a class?), but it is that way.

AlmightyDeaks (5)

@Coder100 do you have any idea why I'm not getting any errors?

Coder100 (18934)

most likely the reason is a replit bug. @AlmightyDeaks

codingjlu (484)

@Coder100 more like eh he mixed up hex and rgb.

ch1ck3n (2393)

math is not defined