-
Variable types such as strings and integers are only able to hold a single type of data.
-
Arrays are one variable type capable of storing multiple values.
-
Most Javascript values have properties. These define some characteristic about the values in a data structure
-
Null and undefined are the exceptions that do not have properties in javascript.
-
Properties in a value can be accessed using a dot and the literal name of the property.
-
Methods are properties that hold function values. These are special kinds of functions that only work on the value they belong to.
-
Objects are data structures that are capable of containing an arbitrary collection of properties. These are created using braces to contain a list key/value pairs separated by a comma.
-
Objects are special as they are able to hold as many different datatypes as we want or need.
-
Objects are defined as any other variable, with the value being a list contained within braces.
-
The mutability of Javascript objects means that the values they contained can be changed.
Part 2
-
A string is not an object but a primitive type, so they are immutable.
-
These are denoted by a functionâs last parameter with 3 dots before its name and are useful for functions that accept any number of arguments. When the function is called, the rest parameter is bound to an array containing all further arguments.
-
Serialisation is converting data stored in memory into a flat description of what that data is. It is useful for when we want to do things like saving the data to a file or transferring it to another computer on a network.
-
JavaScript Object Notation is a serialisation format widely used for data storage and communication.
-
All property names need to be surrounded in double quotes and only simple data expressions are allowed. So no function calls, bindings, or anything that involves actual computation. Also, comments are not allowed in JSON.