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 Numbers The Math Object JavaScript Numbers Review

The correct answer should be the parse function?

I think in this review the answers are not clear anyone help me change my mind please?

on the string to number question its says the unary plus, the math.round, the typeof or nan property. Thanks

It is very vocabulary specific. "Unary plus" is the name of the operator that converts a string to a number via:

const numString = '6';
const numInt = +numString;

numInt stores the integer 6.

However, without the vocabulary, you can get this one by process of elimination.

  • the Math.round() method will round a number to the nearest integer.
  • the typeof operator will return the data type of the object you pass, but will not do any conversion.
  • the NaN property, well... properties can't convert data types

1 Answer

On the quiz there is no option for that.

When I looked at that quiz, one of the answers is "The unary plus (+)"

The example I gave above is what the unary plus looks like in the code.