HTML and CSS Reference
In-Depth Information
> t
"Hello world"
When we appended “test” to the string held against the variable s , the underlying string was
not modified; instead a new string was created and assigned to the variable s . Since t still
refers to the original string, it is not impacted by the modification.
Numbers
The number type is used to represent both integer and floating-point values; in fact all num-
bers are 64 bit floating-point numbers in JavaScript:
> n = 6.827
6.827
> typeof n
"number"
> n2 = 6
6
> typeof n2
"number"
Due to the fact that all numbers are floating-point, operations between two integers can re-
turn floating-point results (unlike in Java).
> 1/3
0.3333333333333333
In addition to real numbers, JavaScript also supports a number of special values.
Search WWH ::




Custom Search