We're going to take a detour away from the aesthetically pleasing and obviously useful world of web pages, so that we can learn some programming fundamentals. But don't worry! We'll be back in no time.
Here at the
1 + 2; and pressing Enter.
You should see something like:
> 1 + 2; 3
1 + 2 - evaluated it, and returned the result:
Now try these:
4 - 3;
5 * 6;
10 / 2;
9 / 2;
7 + 8 * 9;
(7 + 8) * 9;
Try some other arithmetic yourself. Play around with the
% operator, called modulo. It will give you the remainder of dividing two numbers. Don't be fooled into thinking it has something to do with percentages!
% are called operators. An operator is a special character (or characters) that indicates an action to be performed.
Try dividing 0 by 0. The result,
NaN is actually considered a type of number (bizarre as that may seem).
Try dividing any other number by 0. The result,