Data Structures (Arrays and Objects) - Reading Assignment

  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 store data that is easily mutable and accessible. It’s impossible to do that with strings

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

    We can use arrays or objects

  3. What are properties in Javascript?

    Properties are attributes that are contained in an object

  4. Which values do not have properties?

    Null and undefined

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

    Object.x, object[x]

  6. What are methods?

    Properties that contain functions are called methods.

  7. What are objects?

    You take a single value and assign it to a list of multiple properties that you can
    access by calling the key or name of the property

  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)?

    To access the property, we only need to know the name and not the position, like we would have to in an array. We can also easily edit and remove data, with integers, strings, and booleans we do not have the ability

  9. How do you define an object?

    var object = { }

  10. What can you say about the mutability of Javascript objects?

    They are very mutable

Part 2

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

    Because they are immutable

  2. What are rest parameters?

    A rest parameter allows indefinate number of arguments as an array

  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?

    It helps to convert memomory addresses and other data to flat format so other computer can read it, where you left off

  5. What is JSON?

    JSON is a way to seralize data, it is a data storage and a communication format on the Web, can be used with other languages besides JS

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

    Everything needs to be surrounded by double quotes and only simple data expressions are allowed, comments are not allowed either

1 Like

1.) There is alot of different Data.
It wouldnt be efficient to store everything the same way (string as example) iuf you want to use the data.
2.) An Array
3.) Values associated with an object. Example: color, length.
4.) null, undefined
5.) with a dot (value.x) or with square brackets (value[x])
6.) Properties that contain functions. They are a method of the value they belong to.
7.) an arbitrary collection of values
8.) We can tie different information / values into a single object.
9.) Can be created by using braces.
10.) The values in an object can be modified.
11.) The value in a string remains the same. Strings can be combined or new values be derived. Other codee cant change a string.
12.) Is an array that is used in functions. Can be created by writing … before the last parameter.
14.) convert Data to be stroerd in one location. (Converted to flat description)
15. JavaScript Object Notation.
popular serialized format also used outside of JavaScript.
16. -property names have to be surrounded by double quotes.
-no function calls, bindings, computation
-no comments

1 Like
  1. Strings or integers can hold only single data. It is needed variables that can hold multiple data.
  2. Array is a data type for storing sequences of values.
  3. Properties are expressions of some value.
  4. Null and undefined.
  5. With the Dot and square brackets.
  6. Properties that contain methods.
  7. Objects are values that are arbitrary collection of properties.
  8. It is possible to assign a value to a property expression.
  9. An object is define using braces.
  10. You can change their properties.
    2nd part
  11. It is immutable. It is imposible to change the value.
  12. When a rest parameter is called, it is bound to an array containing all further arguments.
  13. The process in which data is converted into a flat description suitable for data storage and communication.
  14. It is a popular serialization format.
  15. In Jason, all properties names have to be surround it 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. Multiple values store in one variable.
  2. Array.
  3. Almost all javascript values have properties, which define characteristic of the data.
  4. Null.
  5. . or [ ]
  6. Properties that contain functions are generally called methods of the value they belong to.
  7. Object are arbitrary collections of properties.
  8. Object can hold many data types.
  9. Object can be defined as any other type of variables.
  10. The value type can be changed.
    Part 2
  11. String is immutable.
  12. The rest parameter syntax allows us to represent an indefinite number of arguments as an array.
  13. serialisation is the process of translating a data structure or object state into a format that can be stored or transmitted and reconstructed later.
  14. JavaScript Object Notation.
  15. All property names need to be double quoted and only simple data expressions are used. No comments allowed.
1 Like
  1. Jacques keeps turning into a squirrel instead of a werewolf but what he does is he started keeping a daily log of everything he does on a given day and whether he changed form.

  2. he started using arrays in javascript

  3. They are expressions that access a property of some value.

  4. null & undefined

  5. With a dot and with square brackets.

  6. The push method adds values to the end of an array, and the pop method does the opposite, removing the last value in the array and returning it.

  7. Objects are Values of the type object are arbitrary collections of properties. One way to create an object is by using braces as an expression.

  8. you can store different sets of data and information between them, and alot of it.

  9. used to build data structures, often identified with braces.

  10. Numbers, strings, and Booleans, are all immutable. you cannot change them you can combine them and derive new values but, when you take a specific string value, that value will always remain the same. The text inside it cannot be changed. If you have a string that contains “cat”, it is not possible for other code to change a character in your string to make it spell “rat”.

SECOND PART

  1. because strings are immutable meaning you cannot change it.

  2. three dots that computes the maximum of all the arguments it is given.

  3. skip i hate math even though math has everything to do with our lives.

  4. Serialization means it is converted into a flat description. A usecase of serialisation is a format called JSON

  5. JSON is used as a data storage and communication format on the Web, even in languages other than JavaScript.

  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?

Provide ways to group several values into a singel value.

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

An array →

  1. What are properties in Javascript?
    Properties hold data that are specific to a given object, (CarModel:“BMW”, color:“Red”) carModel and color are the properties.

  2. Which values do not have properties?
    null and undefined

  3. How can we access properties in a value (two ways)?
    dot . and the [] square brackets.

  4. What are methods?
    Properties that contain functions are generally called methods of the value
    they belong to.

  5. What are objects?
    Is a collection of properties.

  6. 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 can hold differents types of data into a single value

  7. How do you define an object?
    We can define an object using braces.
    var Pupil=new Object();
    pupil.pnr=860734-0000;
    pupil.name=“btc bitcoin”;
    pupil.salary=55000;

  8. What can you say about the mutability of Javascript objects?
    A single object value can have different content at different times.

Strings and their properties

  1. Why can’t you add new properties to a string variable?
    A string is not a object, the value are immutable and cannot be change.

  2. What are rest parameters?
    It can be useful for a function to accept any number of arguments

  3. What is serialisation and what is a use case of serialisation of data?
    Is a mechanism of writing the state of an object into a bytes of stream.
    Its main purpose is to save the state of an object in order to be able to recreate it when needed.

  4. What is JSON?
    Serialize data that converts into a flat description, used as a
    data storage and communication format on the Web.

  5. What are the differences between JSON and the way programmers write objects in plain Javascript?
    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. An easy accessed variable type which can store multiple values.

2) An array.

3) Properties are the values associated with a JS object.

4) null, undefined

5) objectName.property or objectName[“property”]

6) Properties that contains different functions.

7) A JS object is a collection of unordered properties.

8) A object can store and hold different datatypes.

9) let anObject = {propertyOne: 1, propertyTwo: 2};

10) Javascript objects are not immutable. Their properties can be changed so that a single object value may change differently depending on the time.

SECOND PART:

1) Values of type string are not objects and immutable.

2) Rest parameters are bound to an array containing all additional arguments given to a function.

3) To serialize data is to flatten the description of the data.

4) JSON is a popular serialization format, it stands for JavaScript Object Notation, it is ised as a data storage and communication format on the Web and even for other languages.

5) JSON is the standard for serializing objects in JS. It extends for Java Script Object Notation

6) JSON is used for simple data and cannot store functions and computation performing expressions. All the property names also surrounded by double quotes too.

1 Like

First round

  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?***string and integers can hold a single piece of information instead the arrays can hold multiple information and recall them when needed.
  2. What variable type can be used in order to solve the problem of storing multiple values? We can use arrays.
  3. ***What are properties in Javascript?***Almost all JavaScript values have properties. The exceptions are null and undefined. If you try to access a property on one of these nonvalues, you get
    an error.
  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. Both value.x and value[x] access a property on value
  6. ***What are methods?***Both string and array values contain, in addition to the length property, a
    number of properties that hold function values
  7. What are objects? Values of the type object 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)? objects hold many datatypes
  9. ***How do you define an object?***objects are defined as any values within braces. each name of the object is separated with colons. Objects can be modified.
  10. ***What can you say about the mutability of Javascript objects?***The types of values discussed in
    earlier chapters, such as numbers, strings, and Booleans, are all immutable—it
    is impossible to change values of those types

SECOND PART:

  1. Why can’t you add new properties to a string variable? the value of the sting will remain the same you can create a new sting with a different value
  2. What are rest parameters?It can be useful for a function to accept any number of arguments. To write such a function, you put three dots before the function’s last parameter. When such a function is called, the rest parameter is bound to an array containing all further arguments.
  3. What is serialisation and what is a use case of serialisation of data? when you want to store data you serialize them meaning converting into flat description
  4. What is JSON? A popular serialization format is called JSON (pronounced
    “Jason”), which stands for JavaScript Object Notation. It is widely used as a
    data storage and communication format on the Web, even in languages other
    than JavaScript.
  5. What are the differences between JSON and the way programmers write objects in plain Javascript? 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

First Part
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 a record of dates, squirrel status and specific activities in a way that can be searched, indexed and manipulated to perform calculations. A string or integer does not provide this as they are only able to hold a single type of data. Our friend needs a data structure that is capable of storing these multiple values and datatypes.

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

3. What are properties in Javascript?
Most Javascript values have properties. These define some characteristic and attributes about the values in a data structure like the length of an array or the index of its value.

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

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

6. What are methods?
Methods are properties that hold function values. They only work on the value they belong to that enable data to be manipulated (like toUpperCase & toLowerCase)

7. What are objects?
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. 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 hold as many different datatypes as we need.

9. How do you define an object?
Objects are defined like any other variable, with the value being a list contained within braces.

10. What can you say about the mutability of Javascript objects?
The values of the Javascript objects can be changed. You can change the object’s properties.

SECOND PART:
1. Why can’t you add new properties to a string variable?
Because strings are immutable.

2. What are rest parameters?
They represent an array with all argument that will be included and are called by writing 3 dots before the function’s name.

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

4. What is serialisation and what is a use case of serialisation of data?
Serialisation means to flatten the description of the data. Serialisation is useful when saving the data to a file or transferring it to another computer on a network.

5. What is JSON?
Javascript Object Notation is a serialisation format widely used for data storage and communication.

6. What are the differences between JSON and the way programmers write objects in plain Javascript?
JSON appears very similar to Javascript but with the following restrictions.

  • All property names must be surrounded by double quotes, only simple data expressions are allowed.
  • No function calls
  • No bindings
  • Can’t do anything that involves computation
  • Comments are not allowed
1 Like

Part1

  1. We need to be able to hold multiple values and to recall them.
  2. Arrays are able to do this.
  3. A property is a handle which belongs to an object.
  4. Undefined and Null
  5. value.x and value[x]
  6. Properties that are able to have multiple functions
  7. A group of properties
  8. It can hold different datatypes in one value.
  9. Ojects define by having it’s values within brackets and separated by colons
  10. They are able to be changed.

Part2

  1. Strings are immutable
  2. Rest parameter is bound to an array containing all further arguments.
  3. N/A
  4. When data is converted into a flat description.
  5. JSON is a serialization standard for Javascript.
  6. JSON property names must be in quotes, and values have to be values (no bindings).
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?
    Multiple values need to be saved in a single variable and be accessible, which can be done more easily with arrays.

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

  3. What are properties in Javascript?
    They store the elements of an array

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

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

  6. What are methods?
    It is a property that contains functions

  7. What are objects?
    It’s an arbitrary collection 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)?
    Objects can contain multiple value types and group them into a single value for an easier way of storing groups of data.

  9. How do you define an object?
    By using braces as an expression that contains multiple properties, each of which contains a value of its own.

  10. What can you say about the mutability of Javascript objects?
    Object’s values can be modified, meaning they are mutable, while other value types like strings, integers and Booleans cannot be modified, meaning they are immutable.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    Because string variables are immutable and cannot store additional properties beyond those that are built into JS.

  2. What are rest parameters?
    Rest parameters spread out an array, passing its elements as separate 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?
    The conversion of data into a flat description. It’s widely used as a data storage and communication format.

  5. What is JSON?
    JSON stands for JavaScript Object Notation

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    All property names have to be surrounded by double quotes and only simple data expressions are allowed

1 Like
  1. A string or number variable on its own cant group value together like an array. Organizing code and grouping values requires arrays
    2)Array
    3)Properties express some value specific to a given object
    4)null and undefined
  2. . and [ ]
  3. properties that contain methods
  4. collections of methods
  5. objects can hold much data
    9)using braces
    10)the value can be changed

1)strings are immutable
2)represents arrays with arguments that can be called by writing 3 dots before the functions name
4)flat description, typically found in JSON format
5)Javascript Object Notation is a format used for data storage and communication
6)Property names are doubled quoted, simple data expressions only allowed, no function calls, no bindings, no computation, no 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?

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

  3. What are properties in Javascript?
    Properties are characteristics of values.

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

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

  6. What are methods?
    Properties that contain a function.

  7. What are objects?
    Objects are data structures holding the values of an arbitrary collection 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)?
    Aside from being able to contain the values mentioned, objects will process the attached values the same way even if the inherit property of said value is changed.

  9. How do you define an object?
    A container holding multiple values and implementing some functionality with which we can interact using it’s properties and methods.

  10. What can you say about the mutability of Javascript objects?

The mutability of JavaScript objects refers to the fact that their properties can be changed at anytime.

1 Like
  1. Why can’t you add new properties to a string variable?
    Because a string is not an object.

  2. What are rest parameters?
    Rest parameters are 3 dots that represent an arbitrary number of parameters as the function input.

  3. What is serialisation and what is a use case of serialisation of data?
    Converting data into a flat description which makes it convenient to save data to a file.

  4. What is JSON?
    JSON stands for JavaScript Object Notation… is a popular serialization format. It is widely used as a data storage and communication format on the Web.

  5. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON looks similar to JavaScript’s say 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 also 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?
The person needs to store multiple values that include strings and integers.
2. What variable type can be used in order to solve the problem of storing multiple values?
Array
3. What are properties in Javascript?
Characteristics of an object, that describe attributes of a data structure.
4. Which values do not have properties?
null & undefined
5. How can we access properties in a value (two ways)?
by using: i.e. value.object or i.e. value[“pizza time”]
6. What are methods?
Functions that belong to certain properties. i.e. toUpperCase
7. What are objects?
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)?
Storing multiple types of values in a single position
9. How do you define an object?
Define a variable that holds properties within braces, each separated by a comma
10. What can you say about the mutability of Javascript objects?
Javascript objects can have different properties at different times, making them mutable throughout any program running

SECOND PART:

1. Why can’t you add new properties to a string variable?
String values are immutable so new properties cannot be set on them.
2. What are rest parameters?
The rest parameter allows a function to accept an indefinite number of arrays (…)
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 conversion of data into a flat description that makes it more efficient to send program code to others or simply save your code for later.
5. What is JSON?
Javascript Object Notation, which is the data storage and communication format commonly used
6. What are the differences between JSON and the way programmers write objects in plain Javascript?
All property names have to be surrounded by double quotes and only simple data expressions are allowed- no function calls or things that involve actual computation

1 Like
  1. That strings just will storage data but we would not be able to process it properly, like sorting the value of the data

  2. The arrays.

  3. They are characteristics included in a value which we can access.

  4. null and undefined.

  5. Using the name of the variable plus dot. i.e. value.property or using the name plus square brackets.i.e. value [property].

  6. They are properties that contain functions.

  7. They are arbitrary collections of properties.

  8. That we can store in a variable a set of properties that may include several values.

  9. Like a value that allow us to include several properties with several values in a variable and allow us to manage that information properly.

  10. Some values like strings or numbers have a characteristic that impede us to modify their values. Despite of the fact objects works different and may have different content at different times. The value content in a variable may have the same name (“be the same”) and have different value because it is attached to a different variable.

SECOND PART

  1. Because strings are inmatable and it is impossible to store properties in them despite of the language alow us to do it.

  2. They are parameters that allow us to make a function accept any number of arguments. Using three dots before the function´s last parameter.

  3. Serialisation is the way of processing data according to an standard to be reading in other computers or webs.

  4. It is a serialisation format used in several languages other than JavaScript.

  5. They are, all property names have to be surrounded by double quotes, and only simple data expressions are allowed (no function calls, bindings…) and Comments are not allowed in JSON

1 Like
  1. Multiple data types that cannot be grouped together without using an array.
  2. Array
  3. Properties are a characteristic of an object.
  4. Null and undefined.
  5. Dot method - object.propery
    and Square brackets - property access: object[‘property’]
  6. Methods are properties that contain functions.
  7. Objects can be pictured as an octopus, with any number of tentacles - each grasping a property representing a value.
  8. Numbers, strings, and Booleans are all immutable, its is impossible to change the values of those types. Objects are mutable, and their properties can change at different times.
  9. Object()
  10. Object mutability means you can change their properties. A single object can have different value at different times.

SECOND PART:

  1. Values of type string are not objects, and are immutable and cannot be changed.
  2. The rest parameter allows a function to accept an indefinite number of arguments as an array.
  3. 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.
  4. JSON (JavaScript Object Notation) is a syntax for storing and exchanging data.
  5. JSON names must be wrapped in " ", and cannot use objects. Whereas in JavaScript you can.
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 of storing a sequence of values, and having a good way of retrieving those values.
  2. What variable type can be used in order to solve the problem of storing multiple values?
    an array (which is a type of object)
  3. What are properties in Javascript?
    Values have properties, for example, a string has ‘length’ as a property
  4. Which values do not have properties?
    null and undefined
  5. How can we access properties in a value (two ways)?
    value.x or value[x] (dot notation or square brackets)
  6. What are methods?
    properties that contain functions, e.g. toUpperCase for strings
  7. What are objects?
    objects are values that 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 allow you to group together a series of entries that are not just numbers or strings
  9. How do you define an object?
    using braces, e.g.
let day1 = {
squirrel: false,
events: ["work", "touched tree", "pizza", "running"]
};
  1. What can you say about the mutability of Javascript objects?
    objects are mutable in js, whereas numbers and strings are not - meaning that you can change their properties

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    Because it is immutable - can’t be changed
  2. What are rest parameters?
    parameters that accept as many arguments as you give them (I think), e.g. …numbers
  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 = converting data into a flat description
    It can be used as a convenient and efficient way to send data from one computer to another
  5. What is JSON?
    a popular serialisation format used in javascript
  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    They are similar, with the following differences: 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?

    He needs variable that can store multiple values.

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

  3. What are properties in Javascript?
    Informations about variables, objects, functions…

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

  5. How can we access properties in a value (two ways)?
    We can acces to properties with . (dot) or brackets []

  6. What are methods?
    Properties that cointain functions.

  7. What are objects?
    Data structures for more variables.

  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 access to some variable if we use strings or something else. In array, we can use only indexes.

  9. How do you define an object?
    Firstly, new variable, brackets…
    let day1 = {
    squirrel: false,
    events: [“work”, “touched tree”, “pizza”, “running”]
    };

  10. What can you say about the mutability of Javascript objects?
    JavaScript objects are mutable in that their values can be modified. For instance you can change their properties, causing 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?
    A string is not an object so it doesn’t have the ability to store new properties.

  2. What are rest parameters?
    Rest parameters can let us represent an unlimited 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?
    If you want to save data in a file for later or send it to another computer over the network, you have to somehow convert these tangles of memory addresses to a description that can be stored or sent.

  5. What is JSON?
    Type of file for javascript. Json is used as data storage and communication format on the web.

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

    JSON notation do not hold any computation, it is only characters

1 Like

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 a variable that can archive several types of vales, in different positions, and that can be readable separately.

What variable type can be used in order to solve the problem of storing multiple values?
Storing multiple values of the same type can be used using an Array

What are properties in Javascript?
Properties are pre-defined operations in JavaScript that allow us to manipulate it’s content.

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

How can we access properties in a value (two ways)?
We can access a value with a dot preceding the name - value.prop - or using square brackets - value[prop]

What are methods?
Methods are properties that contain functions - toUpperCase is a method of a string.

What are objects?
Objects is an element that may contain several properties. This properties are written between curly brackets, separated by commas.

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 may have different properties, and each one can be of a different type: integer, string, array, boolean… And the good thing is that we can access and modify each one independently.

How do you define an object?
let object = {opt1 : false,
opt2 : [“a”, “b”, “c”],
opt3 : 3 };

What can you say about the mutability of Javascript objects?
Mutability allow us to give different properties the same value in different memory spots. Lets say we have 3 properties: opt1, opt2 and op3. If we say that opt1=10, opt2=opt1 and opt3=10, when we change the value of opt1, opt2 will have the same value, but if we compare opt1 and opt3 they will be different, even if they have the same value they don’t share it.

Why can’t you add new properties to a string variable?
Because a string will always be a string, anything we add to the string will be considered text, even though it can be a integer or boolean - 1, 2, 3, true, false - all converted to text

What are rest parameters?
Rest parameters allow us to select all the elements of an array only by using the 3 dot notation (…).

What is serialisation and what is a use case of serialisation of data?
Serialization is a system that allow us to convert and flatten the data, so we can store them in a web server.

What is JSON?
JSON is a popular serialisation system used as data storage and as standard communication format.

What are the differences between JSON and the way programmers write objects in plain Javascript?
Since JSON is only a way of writing array and objects there is no computation in here, so functions and bindings are not allowed. The other difference is when we are defining an object all the properties names must be within quotes
let object = {“opt1” : false,
“opt2” : [“a”, “b”, “c”],
“opt3” : 3 };

1 Like