Not sure why these objects are returning true? I’ve tested with ‘==’ and ‘===’. I’m sure it’s something I’m overlooking but not sure what.
But variables ‘firstNum’ and ‘secondNum’ should not be equal to each other.
Thanks in advance!
Not sure why these objects are returning true? I’ve tested with ‘==’ and ‘===’. I’m sure it’s something I’m overlooking but not sure what.
But variables ‘firstNum’ and ‘secondNum’ should not be equal to each other.
Thanks in advance!
When you debug it line by line, what are the two values of firstNum and secondNum? It is possible that you are generating the same number twice a lot
That’s what I’ve been doing and why I asked because I can’t find it. Even on line 20, the 2 values are immediately placed into the Div Element, and they show different values. I’ll continue looking through my code, thanks for the advice.
I just ran this in the console, and the values returned as expected, false
So I’m not sure why it doesn’t work in Playcanvas like this. Must be in my code.
What I would try is put a breakpoint on console.log(“Double”) and check the values there. I can’t see anything wrong with the code you’ve highlighted.
Yea I found my issue, as you mentioned, the function was executing twice and I was only seeing the last result. Thank you for your help!