FIRST PART
Q.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?
A.1. Use of Arrays for storing sequences of values. It would be time consuming/awkward
using strings and integers to store data arrays.
Q.2.What variable type can be used in order to solve the problem of storing multiple values?
A.2 A type called an array and is written as a list of values between square
brackets, separated by commas.
Q.3.What are properties in Javascript?
A.3. Meta data about the data, gives description/details/property of the data/value itself
examples the Math.max (property named max in the Math object)
Q.4.Which values do not have properties?
A.4. Values of type string, number, and Boolean are not objects, since
they are immutable
Q.5.How can we access properties in a value (two ways)?
A.5. (a.)dot notation example array.length
(b.)square bracket notation example array[âlengthâ].
Q.6.What are methods?
A.6. Values (Strings and arrays) contain properties as well as hold function values.
Q.7.What are objects?
A.7. Arbitrary values that havae a collection(s) of properties.
Q.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)?
A.8. Each object can store a list of values, (strings, booleans) that
have their own set of properties.
Q.9.How do you define an object?
A.9. (a.)Values that are a arbitrary collections
(b.) Values that have arbitrary collections of properties.
Q.10.What can you say about the mutability of Javascript objects?
A.10.With objects it is possible to change their properties. A single
object value can have different content at different times.
SECOND PART:
Q.1.Why canât you add new properties to a string variable?
A.1. In JavaScript strings are considered immutable (cannot be changed)
Q.2.What are rest parameters?
A.2. Type of function that accepts any number of arguments
Q.3.What is serialisation and what is a use case of serialisation of data?
A.3. When data means it is converted/parsed serialized/encode format then stored for later
for later use to send to another computer over a network. The data will have been
converted from these memory addresses.
Q.4.What is JSON?
JavaScript Object Notation. It is used as a data storage and communication
format on the Web.
Q.5.What are the differences between JSON and the way programmers write objects in plain Javascript?
A.5. When compared to JavaScript, JSON format has limitations:
(a.) all property names have to be surrounded by double quotes
(b.) only simple data expressions are allowed
(c.) no function calls, bindings
(d.) no computation strings
(e.) comments are not allowed