1.Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
For this occasion we need to collect multiple variables and organise them. A simple string or integer variable can not represent such information itself.
2. What variable type can be used in order to solve the problem of storing multiple values?
An array can be used to store a sequence of multiple variables.
4. Which values do not have properties?
The exceptions are null and undefined. If you try to access a property on one of these nonvalues, you get an error.
5. How can we access properties in a value (two ways)?
6. What are methods?
Properties that contain functions are generally called methods of the value they belong to, as in “toUpperCase is a method of a string”.
// → DOH
7. What are objects?
Objects are arbitrary collections of properties. One way to create an object is by using braces as an expression.
8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
With Objects we can store sequences of multiple different value types.
9. How do you define an object?
A list of properties separated by commas. Each property has a name followed by a colon and a value.
The values numbers, strings, and Booleans, are all immutable. Compared to this object values can be modified. Their properties can change their value.
1.Why can’t you add new properties to a string variable?
A string varible doesn’t actually store properties, which you would like to add like for objects. The values numbers, strings, and Booleans, are all immutable.
2.What are rest parameters?
The rest parameters gather all the remaining values in an array.
3.What is serialisation and what is a use case of serialisation of data?
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.
4.What is JSON?
JSON is a popular serialization format. It is widely used as a data storage and communication format on the Web.
All property names have to be surrounded by double quotes, and only simple data expressions are allowed—no function calls, bindings, or anything that involves actual computation. Comments are also not allowed in JSON.