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 The Solution

Gal Parselany
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gal Parselany
Full Stack JavaScript Techdegree Graduate 26,281 Points

My Solution :

const pi = Math.PI;

function rectArea(width, height) {
  const area = width * height;
  return area;
}

function rectPrism(width, height, length) {
  const prism = width * height * length;
  return prism;
}

function circArea(radius) {
  const area = pi * (radius ** 2);
  return area;
}

function sphereVolume(radius) {
  const volume = 4/3 * pi * (radius ** 3);
  return volume;
}

console.log(rectArea(5, 22));
console.log(rectPrism(4.5, 12.5, 17.4));
console.log(circArea(7.2));
console.log(sphereVolume(7.2));
Steven Parker
Steven Parker
231,248 Points

Code needs special formatting to look right in the forum. Take a look at these videos about Posting a Question, and this one on using Markdown formatting to preserve the code's appearance.

Steven Parker
Steven Parker
231,248 Points

You can fix it now, click the little rectangle with the 3 dots to reveal the option to "Edit Question".