This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Scooltr
almost 9 years

Please help! Can't find a mistake :(

var rectangle = new Object(); rectangle.height = 3; rectangle.width = 4; // here is our method to set the height rectangle.setHeight = function (newHeight) { this.height = newHeight; };

// help by finishing this method rectangle.setWidth = function(newWidth) { this.width = newWidth; };

// here change the width to 8 and height to 6 using our new methods rectangle.setWidth(8); rectangle.setHeigth(6);

Answer 555debba76b8fe447e000097

5 votes

Permalink

on the last line, it should be

rectangle.setHeight(6);

you had

rectangle.setHeigth(6);

you added an extra h and missed an h

points
almost 9 years

Answer 5577dd4676b8fe448e00066f

3 votes

Permalink

var rectangle = new Object(); rectangle.height = 3; rectangle.width = 4; // here is our method to set the height var setHeight = function (newHeight) { this.height = newHeight; }; // help by finishing this method var setWidth =function(newWidth){ this.width=newWidth }; // here change the width to 8 and height to 6 using our new methods rectangle.setHeight=setHeight; rectangle.setWidth=setWidth; rectangle.setHeight(6); rectangle.setWidth(8);

points
Submitted by MultiCrAzYmO
almost 9 years

Answer 55668efed3292fac70000332

1 vote

Permalink

the only problem was the h at the end of height

points
Submitted by TheiaCoding
almost 9 years

Answer 555d2e40e39efe732b00044f

0 votes

Permalink

I am having the same problem, and I’ve seen others on this forum posting a code similar to (if not exactly like) your’s. Maybe this is a problem with the website?

points
almost 9 years

Answer 555d3bbd76b8fe7b84000071

0 votes

Permalink

Sometimes i find if you refresh the page it helps.

points
Submitted by Kenneth J. McLeod
almost 9 years

Answer 5602d97151b88726a0000314

0 votes

Permalink

var rectangle = new Object(); rectangle.height = 3; rectangle.width = 4; // here is our method to set the height rectangle.setHeight = function (newHeight) { this.height = newHeight; }; // help by finishing this method rectangle.setWidth = function (newWidth){ this.width = newWidth; };

// here change the width to 8 and height to 6 using our new methods rectangle.setWidth (8); rectangle.setHeight (6);

points
Submitted by Martin
over 8 years

Answer 5559408b86f5524073000793

-1 votes

Permalink

Looks fine to me unless you are having spacing issues.

points
Submitted by Kenneth J. McLeod
almost 9 years

Answer 556e169e93767602c4000509

-3 votes

Permalink

hi

points
Submitted by Link
almost 9 years