Jump to content

Steps to Create a Shape constructor function that has a height and width property. Include a method that will calculate the area of the shape, where


rissa146

Recommended Posts

If you're taking a course then you probably should check some of your course material for the answer. If you're not taking a course then where did you find this problem?

 

Your first answer would solve the constructor problem if the syntax was correct, but you have not created a method that returns the area. It would also be better to give a meaningful name to your object rather than "myFunct"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...