- 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?
The problem introduced in this chapter is that each tracking entry needs to store a list of activities, and to determine a true or false answer. With strings you run into problems accessing the data. With Arrays you can easily access individual pieces of data.
- What variable type can be used in order to solve the problem of storing multiple values?
An [Array] is used to store multiple values.
- What are properties in Javascript?
Properties describe the values such as the length, the minimum, maximum, etc.
- Which values do not have properties?
null and undefined do not have properties.
- How can we access properties in a value (two ways)?
You access properties with a dot and with [ ], they access a property value, but not necessarily the same property.
- What are methods?
Methods are basically properties that hold function values.
- What are objects?
Objects are collections of properties.
- 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)?
Objects allow you to store and access information in a data set.
- How do you define an object?
An object is a list of properties set within {} and separated by commas. The property name is followed by a colon and the value.
- What can you say about the mutability of Javascript objects?
Object values can be modified. You can change their properties, causing object value to have a different content at different times.
- Why canât you add new properties to a string variable?
String variables are immutable and cannot be changed. There are built in properties which resemble the array method such as:
⢠.slice, .trim, . indexOf, .split, .repeat.
- What are rest parameters?
The rest parameters will hold are arguments, which can then be included in other arguments.
-
SkippedâŚ
-
What is serialisation and what is a use case of serialisation of data?
Serialization is when data is converted into a flat description.
- What is JSON?
JSON is a way to store and communicate info on the Web.
- What are the differences between JSON and the way programmers write objects in plain Javascript?
Property names have to be surrounded by double quotes and only simple data expressions are allowed (no functions, bindings or anything involving computation).