You are viewing a single comment's thread. Return to all comments →
Similar to hans-sagita, I did:
function Rectangle(a, b) { return { length: a, width: b, perimeter: (2*a) + (2*b), area: (a*b) } }
For some reason when I did this.length = a; etc, it did not work. Above it returns a set of keys and values within brackets, ie, an object.
Also, this has been the fastest challenge to pass in the 10 Days of JS challenge for me, like <5 to 10 minutes (?).
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Create a Rectangle Object
You are viewing a single comment's thread. Return to all comments →
Similar to hans-sagita, I did:
For some reason when I did this.length = a; etc, it did not work. Above it returns a set of keys and values within brackets, ie, an object.
Also, this has been the fastest challenge to pass in the 10 Days of JS challenge for me, like <5 to 10 minutes (?).