1

I keep getting this error when I try to use the ceil function the error says ceil is not a function.

Below is a picture

enter image description here

I also tried to debug it but I don't see any error!

enter image description here

As you can see the cal has a value of 2.8 which should be rounded to 3 so what's the problem here?

Puka
  • 1,485
  • 1
  • 14
  • 33
  • You should post your actual code instead screenshots of the code. Otherwise its just guessing. – imvain2 Aug 04 '20 at 17:43
  • 1
    Check, what `Math.ceil` is at the time of the error. Set a watch in the debugger for `Math.ceil`, to find where it is being changed. – ASDFGerte Aug 04 '20 at 17:48

1 Answers1

4

So either Math.ceil is not pristine and was replaced with some unexpected code or your call of Math.ceil is using the wrong characters. For example 1 instead of l or с instead of c etc. Try to retype it manually. Try to enter Math.ceil in the browser's console and inspect what it returns.

falinsky
  • 7,229
  • 3
  • 32
  • 56
  • it's a logical stupid mistake my bad somehow in another file and before calling this function i used the ceil function like this Math.ceil=(x / y) don't know how the equal sign got there. so it never gave me error there and the ceil function changed to be a variable somehow. – Aladin Handoklo Aug 04 '20 at 18:24