Data Structures (Arrays and Objects) - Reading Assignment

  1. Variable types such as strings and integers are only able to hold a single type of data.

  2. Arrays are one variable type capable of storing multiple values.

  3. Most Javascript values have properties. These define some characteristic about the values in a data structure

  4. Null and undefined are the exceptions that do not have properties in javascript.

  5. Properties in a value can be accessed using a dot and the literal name of the property.

  6. Methods are properties that hold function values. These are special kinds of functions that only work on the value they belong to.

  7. 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.

  8. Objects are special as they are able to hold as many different datatypes as we want or need.

  9. Objects are defined as any other variable, with the value being a list contained within braces.

  10. The mutability of Javascript objects means that the values they contained can be changed.

Part 2

  1. A string is not an object but a primitive type, so they are immutable.

  2. 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.

  3. 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. JavaScript Object Notation is a serialisation format widely used for data storage and communication.

  5. 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.

1 Like
  1. The need for multiple options vs static variables

  2. an array

  3. an expression that access a property of some value.

  4. null and undefined

  5. with a dot “.” or square brackets “[ ]”

  6. Properties that contain functions

  7. Arbitrary collections of properties1. The need for multiple options vs static variables

  8. an array

  9. an expression that access a property of some value.

  10. null and undefined

  11. with a dot “.” or square brackets “[ ]”

  12. Properties that contain functions

  13. Arbitrary collections of properties

  14. objects use a collection of value types to derive a value based on a layered set of events.

  15. with the use of curly braces “{ }”

  16. They allow you take advantage of a single object value to have different content at different times

Second Part

  1. such values are immutable and cannot be changed

  2. allows us to represent an indefinite number of arguments as an array

  3. a form of saving data so it can be saved into a file or sent from one computer to another

  4. Is a format for serializing data

  5. JSON require double quoting property names, only simple data expressions are allowed, and no function calls, bindings or anything that involves actual computation, and no comments are allowed.

1 Like
  1. Jacques is tracking all his daily activity in order to reveal if there is a relationship between something he does & his transformation into a squirrel. He therefore needs a structure to store the different types of data and use the data in equations to show trends in his activity vs transformation
  2. variable type - object
  3. Property - a way of describing and by extension accessing a value in an object or array, such as colour or length or max from the Math object.
  4. All values have properties except null & undefined.
  5. Access using a dot or square brackets
  6. methods - properties that contain functions of the value they belong to i.e. toUpperCase, toLowerCase, push, pop
  7. objects are arrays that store sequences of things
  8. objects contain a collection of properties and values
  9. objects are defined with braces containing property names followed by a colon and a value and separated by commas.
  10. mutability of objects - properties, values and bindings can be changed, use the binding let to change the value it points at, use const when you want to continue to point at same object, yet contents may be changed

second part

  1. strings immutable - to protect integrity of the string; use methods to access
  2. rest parameter - a three-dot notation, …variableName, it is bound to an array containing all further arguments
  3. serialization - converts data into a flat description, use case data storage and communication format on the web
  4. JSON - JavaScript Object Notation
  5. difference between JSON & JavaScript - JSON uses simple expressions that does not allow function calls, bindings, computations and comments
1 Like
  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?
    This chapter introduces the idea of a user needing a journal of events occurring each day. However, the data to be captured is not a defined data type in JavaScript and a custom data type is introduced.

  2. What variable type can be used in order to solve the problem of storing multiple values?
    An array

  3. What are properties in Javascript?
    Properties are values associated with JavaScript objects.

  4. Which values do not have properties?
    null and undefined have no associated properties in JavaScript.

  5. How can we access properties in a value (two ways)?
    Properties can be accessed with a dot (eg:myString.length) or with square brackets, (eg: my.String[“length”]). Dot is the preferred. For arrays, the property names of the array elements are numbers and these particular elements can only be accessed using square bracket notation (eg; myArray[0] to get to first element. myArray.0 will not work).

  6. What are methods?
    Methods are properties that contain functions. Whereas a person object might have properties height and weight, BMI (body mass index) would be a method since it is a calculation of the two and is implemented as a function.

  7. What are objects?
    Objects are arbitrary collections of properties where each property has a name and a value (or a function that generates a value).

  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)?
    Objects allow us to build custom data types to hold related information. The atomic value types we’ve learned so far are immutable and cannot be customized in this way.

  9. How do you define an object?
    As a variable but with curly braces and name/value pairs.

  10. What can you say about the mutability of Javascript objects?
    JavasScript objects are mutable. Even objects created with constant binding can have its values changed.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    String variables are not objects even though they have properties that are accessed in the same way an objects’ properties are accessed.

  2. What are rest parameters?
    Rest parameters are a way to specify there can be variable parameters in a function. Useful when the number of parameters varies (eg:like in a ‘maximum’ function). A rest parameter will also extract all the values from an array.

  3. (Feel free to skip the sub-chapter of Math object and Destructing)

  4. What is serialisation and what is a use case of serialisation of data?
    Serialisation is the process of flattening object data. A use case is saving object data to a file. Another is transmitting object data.

  5. What is JSON?
    JavaScriptObjectNotation is a popular format for serialising data on the Web.

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON puts property names within quotes and allows only values and not methods to be serialized.

1 Like

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?
The need to store multiple values and states (transformed or not) in a single day. String and int will only let you store a single value at a time and will make keeping track of which values that relates to which days is going to get very complicated.

2.What variable type can be used in order to solve the problem of storing multiple values?
Arrays let you store multiple values.

3.What are properties in Javascript?
Properties in Javascript are the data that objects in Javascripts is holding. I have mainly experience in OOP and objects is there seen to contain both data(properties) and behavior(methods), I see properties then as the data an object contains.

4.Which values do not have properties?
Null and undefined.

5.How can we access properties in a value (two ways)?
Either with a dot after the value or with square brackets after the value.

6.What are methods?
It is properties that contains functions that belong to the value it is called from.

7.What are objects?
Objects are references to collections of different datatypes and functions that relates to one another.

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)?
They let us reference to more complex collection of values that can be of different types (Strings, functions, arrays, int).

9.How to you define an object?
Using braces as an expression.

10.What can you say about the mutability of Javascript objects?
Javascript objects is mutable which means they can change so that they contain different values than they did initially.

11.Why can´t you add new properties to a string variable?
Because they are immutable and therefore cannot be changed.

12.What are rest parameters?
The rest parameters lets a Javascript function accept an unlimited number of arguments that will get passed in to the function through an array in the argument.

13.What is serialization and what is a use case of serialization of data?
We convert`s the data of objects to a flat description. This flat description let us more effectively send or store this data outside the system.

14.What is JSON?
JSON is one type of format that a serialization process will produce.

15.What are the differences between JSON and the way programmers write objects in plain Javascript?
All property names must contain double quotes and only simple data expressions are allowed meaning nothing that contains actual computation will be allowed. Comments are not allowed as well.

1 Like

What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?

  • Extracting information / properties of elements from arrays

What variable type can be used in order to solve the problem of storing multiple values?

  • Arrays / Objects

What are properties in Javascript?

  • Properties are they way JS stores information / assigns memory [values associated with objects/arrays]

Which values do not have properties?

  • Only null and undefined do not have properties.

How can we access properties in a value (two ways)?

  • We can get at properties by using dot or brackets. The property ‘property’ would be accessible by using both ‘property.x’ or ‘property[x]’

What are methods?

  • Methods are functions you can use to get info or manipulate info from arrays or strings

What are objects?

  • Objects are a way of storing values in JS. They are not indexed in sequential order like arrays [which are a type of object].

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 have key pair values and can be accessed differently [more easily], and edited.

How do you define an object?

  • They use curly brackets. By declaring it like so - let man = {name: “Kieran”}

What can you say about the mutability of Javascript objects?

  • You can change the information held in objects and arrays using code, unlike strings.

Why can’t you add new properties to a string variable?

  • Because once a string is declared, you cannot change it’s values, unlike objects [including arrays].

What are rest parameters?

  • Rest Parameters are allocations of memory made in the program to receive values in the future, such as many arguments from combined arrays.

What is serialisation and what is a use case of serialisation of data?

  • When the code is compressed using serialization, only the core code is left - stripping out spaces, comments, etc.

What is JSON?

  • JavaScript Object Notation is a file format using serialization, to allow data about objects[and arrays] in JS to be stored and sent.

What are the differences between JSON and the way programmers write objects in plain Javascript?

  • JSON looks a bit like arrays, but property names must use double quotes “ “ and it does not allow computation such as functions in it’s format.
1 Like
  1. The data needs to be updated daily so ittl need to be an array

  2. Arrays can be used to store multiple values

3.properties in java script are possed by all values, something as si.ple as the # of letters in a word is a property.

  1. Null and undefined have no values

  2. Properties can be acces by using dot or brackets

  3. Methods are functions that act on values rather than define them, they may count the number of letters in a word, or turn all the letters into capitals, stuff like that.

  4. Objects are collections of values

  5. Objects allow u to create lists that can analyze the data you put into it. U can store booleans and small programs

  6. Braces are used to create objects and the values within are seperates by commas

  7. Objects are static. U can change their valies at any given time throughout a program

1 Like
  1. Why can’t you add new properties to a string variable?
    Values of the primitive types are called primitive values and they cannot have properties.
  2. What are rest parameters?
    The rest parameter syntax allows us to represent an indefinite number of arguments as an array
  3. (Feel free to skip the sub-chapter of Math object and Destructing)
  4. What is serialisation and what is a use case of serialisation of data?
    Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file
  5. What is JSON?
    JSON is a lightweight format for storing and transporting data and used with client server web apps.
  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON is simply a key/value pairs data for interchange where objects are written to store array & inner arrays into browser memory.
1 Like
  1. Variables such as strings and integers can only contain a single element. In order to store multiple elements in a single variable, we need to use arrays.
  2. Arrays and, in a broader way, objects.
  3. Properties are the values associated with objects and arrays, we can consider them like some sort of “sub-variables”.
  4. Undefined and null.
  5. object.property or object[property]
  6. Methods are properties consisting in a function.
  7. Objects are entities that store multiple values (properties and methods).
  8. Objects can store multiple values of multiple types.
  9. As any other variable, but placing the values between braces, separated by commas and by placing a colon between each property name and its value.
  10. The contents of an object’s properties can be changed any time.

SECOND PART

  1. Strings are not objects (nor arrays), therefore they are not capable of storing arbitrary properties (although they have built-in ones).
  2. Rest parameters allow defining a function that can accept an arbitrary amount of arguments and pass them to the function as an array.
  3. (Didn’t skip it, might be useful anyways!)
  4. Serialization is the conversion of data (such as arrays) into a flat description.
  5. JSON is one of (if not THE) most common serialization file format; it stands for “JavaScript Object Notation” and is widely used as data storage format even with other languages such as Python.
  6. JSON files have the same syntax of JavaScript, however they cannot contain comments nor anything involving actual computation (such as binding, functions, etc.); in addition, all property names have to be surrounded by double quotes.
1 Like

PART I

  1. defining more than 1 (type) value in a variable
  2. arrays
  3. most JS values have properties. they are characteristics (properties…) of the particular value (for example: length)
  4. null, undefined
  5. a) array.length (when using a dot, the word after the dot is the literal name of the property)
    b) array[length] (when using square brackets, the expression between the brackets is evaluated to get the property name)
  6. properties that contain functions. these functions can only be used with the value they belong to
  7. objects are data structures that can hold multiple random properties.
  8. they can hold different data types
  9. almost like variables except that we are using {} braces after the = and inside of the braces we specify the different key/value pairs, separated by a comma.
  10. the values that are contained by an object can be changed

PART II

  1. because strings are not objects, therefore they are immutable
  2. they are bound to an array that contains all further arguments. the are defined by 3 dots before the name of the functions last parameter
  3. OKAY
  4. serialization is converting specific data in the memory into a description of that data
  5. JavaScript Object Notation = a serialization format used for data storage
  6. property names must be surrounded by {} and only simple data expressions are allowed
1 Like

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?
The individual in the chapter needs a data structure capable of storing several values to organise the information and figure out a way of solving his problem.
2. What variable type can be used in order to solve the problem of storing multiple values?
Arrays can be used to solve it
3. What are properties in Javascript?
Properties are expressions capable to access a “property” of a value
4. Which values do not have properties?
null and undefined don´t have properties in JavaScript
5. How can we access properties in a value (two ways)?
The two ways are value[x] and the other is value.x
6. What are methods?
Methods are properties that contain functions
7. What are objects?
Objects are the properties within the braces of an array.
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)?
They allow us to collect different types of data.
9. How do you define an object?
Using braces in an expression. Inside the braces we can create an object of several of them.
10. What can you say about the mutability of Javascript objects?
Objects are mutable so their values can be changed.

SECOND PART:

**Why can’t you add new properties to a string variable?

Because a string is not mutable
2. What are rest parameters?
They are parameters that accept any number of arguments
3. (Feel free to skip the sub-chapter of Math object and Destructing)
Skipped
4. What is serialisation and what is a use case of serialisation of data?
Serialisation is a process of converting the data in order to be stored or send. Those are the use cases.
5.What is JSON?
It is a standard to perform the process of serialisation in JavaScript.
6. What are the differences between JSON and the way programmers write objects in plain Javascript?
In JSON the properties has to be written using double quotes. Only simple expresions are allowed. Nothing that require calculation.

1 Like
  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?
    The ability to store information in a way which would then be much more convenient to extract/edit and use later on.
  2. What variable type can be used in order to solve the problem of storing multiple values?
    Array.
  3. What are properties in Javascript?
    Values associated with an object.
  4. Which values do not have properties?
    null, undefined
  5. How can we access properties in a value (two ways)?
    Using a dot or a square bracket after the object.
  6. What are methods?
    Methods are properties that contain functions.
  7. What are objects?
    Objects are collections of the values of properties.
  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)?
    It allows us to group values together.
  9. How do you define an object?
let object1 = {
    property1 : ....,
    property2 : ....,
};
  1. What can you say about the mutability of Javascript objects?
    Objects are mutable in the sense that their properties can be changed.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    Values in a string are not objects and so they are not able to store new properties.
  2. What are rest parameters?
    Parameters that represent any number of arguments as an array.
  3. (Feel free to skip the sub-chapter of Math object and Destructing)
  4. What is serialisation and what is a use case of serialisation of data?
    It is the conversion of the memory addresses of the data to a description format that can be stored or sent. Instead of having to send over the entire computer memory with the addresses needed, a serialised format of the data is sent.
  5. What is JSON?
    JavaScript Object Notation - a serialisation format commonly used for data storage and communication on the web.
  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    In JSON property names are in double quotes and there is no function calls, bindings, computations or comments.
1 Like

Data Structures (Arrays and Objects Answers

Part 1

  1. The variable types such as strings and integers cannot help Jac bbecause they dont provide a data set, Jac needs away to remember & recall the data from the days when he changed to assess the cause of his transformatin. He needs a data structure that can store all the different types of values and the ability to access them.

  2. Arrays, can be used to store sequences of values.

  3. A property in Javascript defines a characteristic of a value in a data structure.

  4. Nonvalues like null and undefined do not have properties

  5. They’re two ways we can access properties in a value, value.x and value[x] the difference resides in how ‘x’ is interpreted with value.x the word after the dot is taken as the literal name of the property. While value[x] , the expression between the square brackets is evaluated to get the property name.

  6. Methods are properties that contain functions of the value they belong to, i.e. “toLowerCase” is a method of a string. Better put Methods are functions that live in properites and usually act on the value they are a property of.

  7. An object is an arbitrary collection of properties

  8. Because object can hold a variety of values related to one subject we are able to do computation to all data points that make up our object.

  9. let myObject = {
    name: “Mikal”,
    age: 32,
    };

  10. That unlike the data type string the contents of an object once defined can be changed.

Part 2

  1. You can not add new properties to a string variable because values of the string type are not like objects, these types of values are immutable.

  2. Rest parameters are bound to an array, that can contain any number of arguments. A rest parameter uses three dots before the functions last parameter.

  3. Serialization is the process of converting data into a flat discription. Uses case for using a serialization formats such as JSON are for data storage and communication across the web.

  4. JSON which stands for JavaScript Object Notation is a serialization format widely used as a data storage and communication format on the web.

  5. Although JSON looks simalar to JavaScript in wrting arrays and objects they’re a few distinctions and restriction. In JSON all property names have to be surrounded by double quotes,and only simple data expression are allowed. Nothing that involves atual comptuation can be allowed. No function calls, variables, or comments.

1 Like

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?
The problem is that Jacques needs to build a larger data structure that can store many values (arrays). Strings and Integers won’t be able to provide that usecase.
2. What variable type can be used in order to solve the problem of storing multiple values?
The variable type that helps the problem of storing multiple values is the array data type.
3. What are properties in Javascript?
Properties in Javascript are features of a value. They could be the length of a value, the maximum, or the color.
4. Which values do not have properties?
The main two values that do not have properties are null and undefined.
5. How can we access properties in a value (two ways)?
The two main ways to access properties are by using a dot (.) or the square brackets ([]). By using the dot, you are aclling the literal name of the property. When you use the square brackets the property is evaluated out of the expression.
6. What are methods?
Methods are properties that contain functions.
7. What are objects?
Objects are arbitrary collections of properties.
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)?
They solve the problem of a limited amount data allowed. They can hold a collection of properties of a dataset.
9. How do you define an object?
To define an object you use braces as an expression.
10. What can you say about the mutability of Javascript objects?
Unlike numbers, strings and Booleans which are immutable, Obejcts are able to be modified, you can change their properties and allow a single object value to have different content at different times.

SECOND PART:
1. Why can’t you add new properties to a string variable?
You can’t add new properties to string variables because they are immutable.
2. What are rest parameters?
Rest parameters allow us to add any number of arguments as an array of a function. By using ellipses (…) you can compose the rest of the provided parameters into a standard JavaScript array.
3. (Feel free to skip the sub-chapter of Math object and Destructing)
4. What is serialisation and what is a use case of serialisation of data?
Serialization is when you convert data into a flat description. This is useful when you want to share data and don’t want to send over your entire computer memory along with it.
5. What is JSON?
JSON is the popular serialization method that stands for JavaScript Object Notation. It is used widely as a data storage and communication format on the web. It can even be used in other languages besides JavaScript.
6. What are the differences between JSON and the way programmers write objects in plain Javascript?
A difference between writing in JavaScript and JSON is for JSON you must put double quotes (" ") around all property names. Comments aren’t allowed in JSON, and also only simple data expressions are allowed; no function calls, bindings, or anything that involves actual computation.

1 Like

First part

  1. With strings and integers we have a problem with storing sequences of values. We need to stack data properly and efficiently.

  2. Arrays and Objects

  3. Almost all JavaScript values have properties, these are expressions that access a property of some value.

  4. null and undefined

  5. value.x and value[x]

  6. Methods are a number of properties that hold function values.

  7. Values of the type object are arbitrary collections of properties.

  8. Storing different datatypes.

  9. Objects are defined using curly brackets, separated by comas.

  10. You can change their properties, causing a single object value to have different content at different times.

Second part

  1. Values of type string, number, and Boolean are not objects, and though the language doesn’t complain if you try to set new properties on them, it doesn’t actually store those properties. As mentioned earlier, such values are immutable and cannot be changed.

  2. The rest parameter is bound to an array containing all further arguments. If there are other parameters before it, their values aren’t part of that array,

  3. …

  4. That means it is converted into a flat description and it is used as a data storage and communication format on the Web.

  5. JavaScript Object Notation

  6. JSON looks similar to JavaScript’s way of writing arrays and objects, with a
    few restrictions. 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 not allowed in
    JSON

1 Like
  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?
    We need to keep track of multiple types of values together which cannot be done through simple variables.
  2. What variable type can be used in order to solve the problem of storing multiple values?
    Objects.
  3. What are properties in Javascript?
    variables of an object.
  4. Which values do not have properties?
    strings, numbers, and booleans.
  5. How can we access properties in a value (two ways)?
    value.x or value[x]
  6. What are methods?
    functions that return property values from objects.
  7. What are objects?
    a collection of arbitrary values.
  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)?
    We can group together arbitrary values and use methods to access them.
  9. How do you define an object?
    a collection of arbitrary values.
  10. What can you say about the mutability of Javascript objects?
    You can change the arbitrary values of objects using methods.

  1. Why can’t you add new properties to a string variable?
    Because they are static values that are immutable.
  2. What are rest parameters?
    An array parameter where each index in the array is treated as a separate parameter.
  3. (Feel free to skip the sub-chapter of Math object and Destructing)
  4. What is serialisation and what is a use case of serialisation of data?
    Serialisation is when data is converted into a flat description. It is often used for data storage.
  5. What is JSON?
    A format for serialisation.
  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    When in JSON, you can only use simple data expressions, and they all must be in double quotes. There are no function calls, bindings, or acutal computation allowed in JSON.
1 Like
  1. *** What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?***
    The issue is that Jaques needs to store alot of data which cannot be solved by strings and integers.
    He needs arrays that can store sequences of values

  2. What variable type can be used in order to solve the problem of storing multiple values?
    Array Data Type

  3. What are properties in Javascript?
    Almost all JavaScript values have properties, these are expressions that access a property of some value.

  4. Which values do not have properties?
    Null and Undefined

  5. How can we access properties in a value (two ways)?
    With a dot and with square brackets. value.x and value [x]

  6. What are methods?
    Are properties that hold function values

  7. What are objects?
    Arbitrary collections of properties

  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)?
    They solve the problem of a limited amount data allowed. They can hold a collection of properties of a dataset.

  9. How do you define an object?
    Use braces as an expression

  10. What can you say about the mutability of Javascript objects?
    Numbers, strings and booleans are immutable while you can change the properties of objects causing a single object value to have different content at different times.

Strings and their properties

  1. Why can’t you add new properties to a string variable?
    Because they are immutable

  2. What are rest parameters?
    Rest parameters allow us to add any number of arguments as an array of a function.

  3. What is serialisation and what is a use case of serialisation of data?
    Serialization is when you convert data into a flat description. This is useful when you want to share data and don’t want to send over your entire computer memory along with it.

  4. What is JSON?
    A popular serialization format

  5. What are the differences between JSON and the way programmers write objects in plain Javascript?
    A difference between writing in JavaScript and JSON is for JSON you must put double quotes (" ") around all property names. Comments aren’t allowed in JSON, and also only simple data expressions are allowed; no function calls, bindings, or anything that involves actual computation.

1 Like
  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?
    They do not have the ability to store multiple values.

  2. What variable type can be used in order to solve the problem of storing multiple values?
    An array

  3. What are properties in Javascript?
    Js values.

  4. Which values do not have properties?
    Null, undefined.

  5. How can we access properties in a value (two ways)?
    With a dot or square brackets.

  6. What are methods?
    Property that holds function value.

  7. What are objects?
    They have properties attached to it that define it’s characteristics.

  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)?
    They can hold different datatypes.

  9. How do you define an object?
    With brackets.

  10. What can you say about the mutability of Javascript objects?
    They change, unlike others.

  11. Why can’t you add new properties to a string variable?
    Because it is immutable.

  12. What are rest parameters?
    They are bound to an array and lets the function use any number of arguments.

1 Like
  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? needs to keep track of properties

  2. ***What variable type can be used in order to solve the problem of storing multiple values?***array

  3. What are properties in Javascript? value of variables

  4. Which values do not have properties? null & undefined

  5. How can we access properties in a value (two ways)? . []

  6. What are methods? properties that contain funcitons

  7. What are objects? colleciton of properties

  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)? datasets / accessing properties

  9. How do you define an object? collection of values

  10. What can you say about the mutability of Javascript objects? they can be chgd via methods

  11. Why can’t you add new properties to a string variable? because they are immutable

  12. What are rest parameters? allow you to add any argument as an array of a function

  13. What is serialisation and what is a use case of serialisation of data? converting data like an array to a decription

  14. What is JSON? js object notation

  15. What are the differences between JSON and the way programmers write objects in plain Javascript? {} are used

1 Like
  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?
    The problem introduces the fact that most data sets are more complex than simple strings and integers. It is often a combination of these along with booleans in the form of an array.

  2. What variable type can be used in order to solve the problem of storing multiple values?
    An array

  3. What are properties in Javascript?
    Properties are the values associated with a JavaScript object. They can include the length of a string, the maximum value and many many others. Properties are essential as they allow us to add more information to an object.

  4. Which values do not have properties?
    Null and undefined. Trying to access these will produce an error.

  5. How can we access properties in a value (two ways)?
    We can access a property by using a dot (.) or by using square brackets ([]). This would be written as value.x or value[x].

  6. What are methods?
    A method is a function that is stored as a property. They can be called using a period after the object. The methods do not require any arguments as they operate on the object attached to them by the period.

  7. What are objects?
    Objects are a collection of named values. Each object has properties and methods. It is similar to tangible objects in that real world objects have properties such as colour and weight along with methods of how they function. Objects are a variable that contain multiple value points.

  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)?
    Objects are able to store many different types of values under one umbrella. An object can contain integers, strings and booleans under one object which allows us to manipulate data on a much larger scale.

  9. How do you define an object?
    You can define an object by using the curly brackets (braces) and inside assign the multiple values with a name followed by a colon then the value you want stored.

  10. What can you say about the mutability of Javascript objects?
    Objects are mutable as the bindings within objects can be altered. The values themselves don’t change but the variables within an object can be altered. Interestingly is two objects have the exact same values they are not considered to be the same.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    Strings are primitive type of value which means that they are immutable. Strings only have the set properties assigned to them and these cannot change.

  2. What are rest parameters?
    Rest parameters have the syntax … inserted before the functions last parameter, the function is then able to take an indefinite number of arguments.

  3. (Feel free to skip the sub-chapter of Math object and Destructing)

  4. What is serialisation and what is a use case of serialisation of data?
    Serialisation is a method of recording data in a specific way so that it can be sent to other computers and be understood when it arrives. It is a more efficient method of transferring data than sending a computers entire memory bank.

  5. What is JSON?
    JSON is JavaScript Object Notation. It is a common type of serialisation that enables users to save their data and sent it to other users to view and use.

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    With JSON only simple data objects are possible, there can’t be computations (including functionality). All property names have to be enclosed with double quotes and comments are not allowed in the code.

1 Like