Returned nan?


#1

Why do i get this?


#2

You're trying to return sidelength * sidelength, and that doesn't exist. Use sideLength (capital L) and it will work.


#3

Thanks!!
I always miss those small things!


#4

Common mistake. When you know you make mistakes on this things, you just have to start trying harder to see them. For me, this kind of mistakes are ones I make most often. Wrong variable name, property name, etc. Still it's better than having bad code.