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 JavaScript Basics (Retired) Working With Numbers Numbers and Strings

please help

create a new variable named total width that multiplies the width by the numOfDivs

app.js
var width = '190px';
var numOfDivs = 10;
var totalWidth = parselnt (width)*numOfDivs;
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>

2 Answers

Steven Parker
Steven Parker
231,275 Points

You just have a spelling/typo error, "parselnt" (with lower-case "L") instead of "parseInt" (with capital "I").

Also, while space is allowed by the language, it is considered a "best practice" when calling a method to follow a method name immediately by the open parenthesis.

Steven Parker
Steven Parker
231,275 Points

:warning: FYI: Explicit answers without any explanation are strongly discouraged by Treehouse, and subject to redaction by moderators.

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi Dennis Eitner ! While we all appreciate your help in the Community, leaving explicit answers that can be copy/pasted directly into a challenge to pass it while not including any explanation is frowned upon. Could you please update your answer to include an explanation? Thanks :sparkles: