Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Array Iteration Methods Array Manipulation Transform Array Items with map()

1 Answer

Steven Parker
Steven Parker
220,464 Points

The word "radix" refers to the number system of a value, and is how many values can be expressed in a single digit. What we normally think of as a number is radix 10. If you work with binary, that's radix 2.

A few examples of counting in different radixes might make it more clear:

// counting in radix 10 (also called "decimal"):
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ...etc.
// counting in radix 2 (also called "binary"):
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001 ...etc.
// counting in radix 16 (also called "hexidecimal"):
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12 ...etc.
// counting in radix 5 (not commonly used):
0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22 ...etc

Note that the value of a number is relative to the radix. When we see "12" we think of that as a "dozen", but that's only true for decimal numbers (radix 10). In radix 16 what looks like "12" has a decimal value of 18, in radix 5 it would be the same as 7 decimal, and it would not be valid at all in radix 2 (binary), since the only valid digits in binary values are "0" and "1".