The character with the Latin-1 encoding specified by up to three octal digits XXX between 0 and 377. Escape sequences are a mechanism for quoting a single character. Strings can contain escape sequences (a single character preceded with a backslash), as shown in Table 3.1. To change a string requires replacing it with another string. The string value "hello" is called a string constant or literal. Strings are called constants or literals. If a number is enclosed in quotes, it is considered a string e.g., "5" is a string, whereas 5 is a number. Single quotes can hide double quotes, and double quotesĪn empty set of quotes is called the null string. If it starts with a double quote, it must end with a double quote. If the string starts with a single quote, it must end with a matching single quote, and likewise String literals are rows of characters enclosed in either double or single quotes. JavaScript numbers can be very large (e.g., 10 308 or 10 –308 ). The letter " e" for exponent notation can be either uppercase or lowercase. They must contain a decimal point or an exponent specifier, See Example 3.1.įloating-point numbers are fractional numbers such as 123.56 or –2.5. Integers can be expressed in decimal (base 10), octal (base 8), and hexadecimal (base 16), and are either Integers are whole numbers and do not contain a decimal point Į.g., 123 and –6. JavaScript supports both integers and floating-point numbers. In addition to the three core data types, there are two other special types that consist of a single value: JavaScript supports three core or basic data types: Such as the number 5.7, or a string of characters such as "hello". They are types that can be assigned a single literal value Primitive data types are the simplest building blocks of a program. These types can be broken down into two categories, primitive data types and composite data types. What kind of data, such as numbers and characters, can be stored and manipulated within a program. But in order to do anything, the program works with the data that is given to it. A program can do many things, including calculations, sorting names, preparing phone lists, displaying images, validatingįorms, ad infinitum.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |