19. More kind of methods


#1

square.calcArea = function() {
return this.sideLenth * this.sideLength;
};

Following error comes
Oops, try again.
** Your method failed when sideLength was 0 where it returned NaN instead of 0**


#2

HI can you post all your code?
then here

return this.sideLenth * this.sideLength;

you wrote this.sideLenth intsead of this.sideLength to the first one.


#3

thankyou changing Lenth to Length worked. a silly mistake


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.