Prev Source
Next Source

JavaScript

JavaScript has a single number type. Internally, it is represented as 64-bit floating point, the same as Java’s double

Unlike most other programming languages, there is no separate integer type, so 1 and 1.0 are the same value.

A string literal can be wrapped in single quotes or double quotes. It can contain zero or more characters. The  (backslash) is the escape character. JavaScript was built at a time when Unicode was a 16-bit character set, so all characters in JavaScript are 16 bits wide.

JavaScript does not have a character type. To represent a character, make a string with just one character in it.

Strings have a length property. For example, seven”.length is 5.

Strings are immutable. Once it is made, a string can never be changed.

it is easy to make a new string by concatenating other strings together with the + operator.

Two strings containing exactly the same characters in the same order are considered to be the same string. So: c’ + a’ + t’ === cat’ is true.

A compilation unit contains a set of executable statements. In web browsers, each

Date
September 18, 2022