From the course: Learning the JavaScript Language

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Numbers

Numbers

- [Instructor] In this video, we're going to talk about another of the basic data types in JavaScript, the number, and we're also going to talk a little bit about math. You know what a number is? 12 is a number. Some programming languages have different types of numbers like integers, floats, doubles, and so on. All numbers in JavaScript are of the same type, called number. So 12 in JavaScript is the same thing as 12.0, which makes sense in terms of how we deal with numbers in the real world. In programming, that's not always the case, but in JavaScript it is. They're both the same thing, and you can have numbers with lots and lots of decimal points. So, if I add a whole bunch more here, it gets truncated a little bit. So you can see, even though I put in a whole bunch of extra digits after that decimal point, JavaScript can't handle that much precision. You probably won't care about that most of the time unless you're…

Contents