Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing the Practice

Tried on different browsers, different .js files, nothing works

function areaRect(width, height){
  return width * height;
}
function areaPrism(width, height, length) {
  return width * height * length;
}
console.log( areaRect(5, 22) );
console.log( areaPrism(4.5, 12.5, 17.4) );

1 Answer

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

Hi Gary Angarita , I just copied your code and tested it out myself, and it works fine. So if you're having difficulty running this, it's likely because of an issue with how you're running it. Double check that your JS file is correctly wired up to your HTML.

If you're struggling with that, this video, and the ones directly before and after should be helpful. :thumbsup: