Ok first of all @miskolin8 and @katerniko Please have a look at this on how to format your code:
It makes it a lot easier to read as it keeps formatting and according to your tries it is also less work to do
You could later add a method to a constructor using the prototype property but as far as I can see this comes in a later exercise. So from what I can see @katerniko 's approach of having 4 properties: height, width and the 2 methods calcPerimeter and calcArea seems to be the way to go.
@miskolin8 The advantage of this over using a regular function and probably the problem in your code is that you don't have to care about height in width as they are already part of the object.
Meaning if you have a function you'd need parameters for height and width so that you can compute the perimeter and in the function call you'd need something like
calcPerimeter(rex.height, rex.width) with rex.height and rex.width as arguments. But with everything wrapped up in one object you just need to call rex.calcPerimeter() because height and width are already part of rex and can easily be accessed from inside the object via this.height and this.width.
I hope this makes sense and is not too confusing otherwise I'll give it another try.
So as you can see the problem in your code is that the calcPerimeter method has parameters but you don't give it arguments. What you do is you update the internal properties width and height with the received arguments. Unfortunately as you don't have arguments passed to the function width and height are set to undefined which leads to
2*undefined+2*undefined -> NaN.
@c-daniels Hope the previous part also answered your question if not maybe open another topic as this seems to be a different problem, or isn't it @miskolin8?