Why does my Log say the Value is NaN?
well, i have this part of my code inside the js now everytime the loop runs it's supposed to generate a random value for x , y , vX , vY and r but when I log the value inside the loop it says all those variables r NaN
this is the part
and this is the codepen
https://codepen.io/-bloop-/pen/bGxRpmw
tnx!!
14 Replies
That part isn't in the linked codepen, but Math.random isn't a value, it's a function
i deleted the previous code and inputted it
i think i need to save it
I don't use codepen so Idk
can u try it rn?
i saved the new code
you can also just make a new one, you can make quite a lot
ahahah..okee
yup, this works:
ooh wait lmaao
you have to call
random
, it's not just a value you can useI didn't add the parentheses
;-;
sorry
no worries, stuff like this happens to everyone, no matter how long you've been programming 😄
works..ty xD
@jochemm how is it xD
canvas is kinda fun
looks good!
I've never really played with canvas, I know you can do some wild things with it
ahaha
yee