rissa146 Posted January 19, 2016 Share Posted January 19, 2016 I am creating a Shape constructor function that has a height and width property. Include a method that will calculate the area of the shape, where area is defined as the shape's height multiplied by its width. Does this look right?function shapeFunct(x,y){ this.height = x; this.width = y; return x * y;}// call the function shapeFunct(100,100); Link to comment Share on other sites More sharing options...
Ingolme Posted January 19, 2016 Share Posted January 19, 2016 There's already a thread for this question. Please continue discussion here: http://w3schools.invisionzone.com/index.php?showtopic=54681 Link to comment Share on other sites More sharing options...
Recommended Posts