|
1 | 1 | The sample code above contains 6 variables. The first three should look familiar as they are just variables that are declared and assigned a value. The fourth and fifth variable, `a` and `b` are declared on the same line. Calling more than one variable in one line is common in JavaScript. This can be achieved using a comma to separate each variable.
|
2 | 2 |
|
3 | | -The two variables `sum` and `div` are not assigned a specific integer, but an addition/division of two variables. This is also common as the expressions on the right are evaluated before assigning the variable an integer. Notice that `div` is actually equal to "Infinity". Dividing any number by 0 will give you this result. The only exception is "0 / 0", which will return NaN (abbreviation for Not a Number). |
| 3 | +The two variables `sum` and `div` are not assigned a specific integer, but an addition/division of two variables. This is also common as the expressions on the right are evaluated before assigning the variable an integer. Notice that `div` is actually equal to "Infinity". Dividing any number by 0 will give you this result. The only exception is "0 / 0", which will return NaN (abbreviation for Not a Number). |
0 commit comments