May 2022
Beginner
304 pages
6h 49m
English
Now that we’ve taken a look at strings and arrays, we’ll continue with a tour of some other important JavaScript objects: math, dates, regular expressions, and generic objects.
Like most programming languages, JavaScript supports a large number of mathematical operations:
> 1 + 1; 2 > 2 - 3; -1 > 2 * 3; 6 > 10/5; 2 > 2/3; 0.6666666666666666
Note that the final example here isn’t exact; it’s a floating-point number (also called a float), which can’t be represented exactly by the computer. But in fact JavaScript has only one numerical type, and even something like 1 or 2 is treated as floating point under the hood. This is convenient for us as programmers, since it means we never have to make ...
Read now
Unlock full access