- In JavaScript, there are two types of data: primitive and reference types. With primitive types, the data is stored directly in the location that the variable accesses it’s stored on the stack. When you access primitive data you access it by its actual value. Reference types are objects that are accessed by reference.
So the data isn’t actually stored in the variable it’s stored on what’s called the heap which has to
do with dynamically allocated memory.
There are six primitive data types: String, Number.Boolean, Null, Undefined, Symbols.
Reference types:Arrays, Object literals, Functions, Dates ,etc.
Arrays allow us to store multiple values in one variable.That’s why Jaques cannot use primitive data types. He needs a data structure to store multiple values. - Arrays
- Properties are ways for us to get certain information about an object.
- Null and Undefined.
- The two main ways to access properties are: -with a dot ex: value.x
-with square brackets ex: value[x] - Methods are functions that belong to the object that allows us to do something to the data inside the object.
- An object is a collection of properties, and a property is an association between a name (or key) and a value. A property’s value can be a function, in which case the property is known as a method.
- We can access and store multiple values in one place.
- An object is a collection of properties.
- Mutable is a type of variable that can be changed. In JavaScript, only objects and arrays are mutable, not primitive data types(values). You can make a variable name point to a new value, but the previous value is still held in memory.
PART TWO
- A string value is immutable.
- The rest parameter is an improved way to handle function parameters, allowing us to more easily handle various inputs as parameters in a function. The rest parameter syntax allows us to represent an indefinite number of arguments as an array.
- Serialization is converting the data into a flat description. You can use serialization to transfer data to another computer over the network.
- JSON= JavaScript Object Nation, a popular serialization format, used as data storage and communication format on the web.
- JSON looks similar to JavaScript’s way of writing arrays and objects, but it has some restrictions: property names have to be in quotes, simple data expressions are allowed(no function calls, bindings, anything that involves computation). No comments are allowed.