- Part 1: Creating and Using Variables
- Part 2: Data Types and Arrays
- Part 3: Functions
- Part 4: Objects
- Part 5: Document Object Model
- Part 6: Conditional Statements
- Part 7: Loops
Data Types and Arrays
Most programming languages have a concept of data types. These are various kinds of data and are usually handled differently.
Different Types of Numbers
Letters and Numbers as Strings
The are often useful when some task needs to use text instead of numerical values.
Arrays as a Sequence of Values
Arrays can also be inside other arrays. In these cases, the array is said to be multidimensional. Instead of being a sequence of values, a single dimension, it can have its own arrays that make it have extra dimensions.
Arrays are called sequences of values because their position can be referenced. Much like a book, an entry in an array has an index. This is the position of the entry and, when used, its value is returned.
In most programming languages, arrays also start with 0. To get the first (0) value in the array, it can be used with the reference using brackets. For example, using “” would return the first value. Using “” would return the forth entry.