Data Structures (Arrays and Objects) - Reading Assignment

  1. It introduces the problem that you cant easily access and extract specific values within the data set you are providing without the use of an array. Using an array allows for you to easily extract specific data samples from you data.

  2. you can use the array variable type.

  3. Properties are essentially characteristics of a value. Properties of values are things such as value length, the max or min of a value, etc.

  4. Null and undefined do not have any properties whatsoever.

  5. We can access properties through using dots or square brackets. The dots are use to get the property by using its name. The square brackets are used to get the property from a value or name.

  6. Methods are properties that execute a function such as .toUpperCase()

  7. Objects are values which store a collection of properties. Creating objects allows for you to create arrays with values that contain many properties which are assigned to it.

  8. Objects allow for you to store many properties within a value.

  9. Objects can be defined with the = operator followed by brackets which contain the assigned properties.

  10. Javascript objects are able to change the value of other objects through bindings. By binding object1 and object2, you can change the value of object1 which then changes the value of obect2.
    SECOND PART

  11. String variables aren’t necessarily objects, therefore you cannot add variables to them. However, string variables do come with built in properties.

  12. Rest parameters are used to pass all the values within an array on through a function as separate arguments. Essentially, you can yield the values of an array separately.

4.Serialization is the process of converting data into a flat description. This allows for data to be sent to another computer easily.

  1. JSON(JavaScript Object Notation) is popular data serialization format that is used for data storage and as a communications format.

  2. The difference is that only simple comments are allowed in JSON. No computation is allowed to be stored with json. All property names must be surrounded by double quotes.

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?
String and integers cannot be used with multiple values, in order to keep track of values such as weather will require us to keep overwriting our old value with today’s weather, while with other types of data structures such as array we can push new value (new index) to the array, and we can use nested array to make the data more organize or to keep more parameters such as date, how much clouds and rain there was, etc.
2. What variable type can be used in order to solve the problem of storing multiple values?
Arrays, Objects, csv, jsons
3. What are properties in Javascript?
For each value type in Javascript there a list of action that we can perform on the value, this action were performed based on the properties of the value-type which are based on he’s characteristic, for example: math actions such as divide and multiply cannot occur on a string\array\boolean value, cause he’s lacking the properties of an integer.
4. Which values do not have properties?
null & undefined
5. How can we access properties in a value (two ways)?
The 2 ways to access a property is via either: value.x OR value[x]
when using the [ ] square brackets JS will evaluate what the value that was intended.
while using the . Dot, the literal name of the value is been called.
6. What are methods?
methods are predefined function that are attached to value types like string and array and can enhance them with those functions. simple array can act as a stack by using methods such as push and pop.
7. What are objects?
objects are values that can contain data structures with several values with different 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)?
Save values with additional information that can enrich the saved value or give it additional context.
9. How do you define an object?
Objects are defined with stating the value name followed by curly braces, within the curly braces each data value will be defined followed by colon and his value,
10. What can you say about the mutability of Javascript objects?
It allows as to ‘make mistakes’ or enrich or edit the objects, so it depends on the project or the usage of the objects, i wouldn’t use it on any data that should be ‘secured’ or use as an important data stamp that is required for an application.
like if I would like to save the time that user have agreed to T&C the time stamp and or additional information regarding this event should not be mutable since it may serve as an evidence in the future.

SECOND PART:

1. Why can’t you add new properties to a string variable?
String are immutable and therefor cannot be changed.
2. What are rest parameters?
In order to use array\several argument in a function.
4. What is serialisation and what is a use case of serialisation of data?
Serialization is a process that converts the required data to transfer to a flat description that used to store data suitable to be transfer over the web.
5. What is JSON?
JavaScript Object Notation used as a data storage and communication format on the web
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 (functions, binding, etc, not allowed)

1 Like
  1. Broadly speaking, there are a series of variables that are not computational through single strings or integers. Some would include defining correlation between squirrel variables and event variables. Meaning the series of journal entries cannot be distilled down to commonality through simple string relationships. likewise the correlation between event and squirrel variables would require a deeper analysis that goes beyond basic computation.

  2. the simplest variable for storing multiple values is an ‘array’

  3. a property relates to the characteristics that define a value. ie - the length of a string. it is a unique identifier.

  4. null, undefined - both do not have property associations, both intrinsically and when used to define a computation.

  5. two ways to access a property are (1) value.x, (2) value[x] (dot and square brackets).

  • in the .dot example, what follows is a literal name of a property.
  • in the brackets [] example, tries to evaluate the expression [x].
  1. properties containing functions are methods of the value they belong to (ie - toUpperCase)

  2. Objects are arbitrary collections of properties, compiled to produce a value output. in the case of our squirrel story, an object would consist of a series of journal entries, probability of outcomes, and a boolean to determine if the calculations are true.

  3. value types (integer, string, array, boolean, etc) are immutable by themselves, cannot be altered to represent something ellse. however, an object will accept changes to properties, thus allowing for a single object value to have different content at different times.

  4. in the context of the squirrelification, an object could be defined as follows:
    let day1 = { (where let declares the variable)
    squirrel: false (boolean reliant value)
    events: [“work”, “touched tree”, “pizza”, “running”] (event ‘properties’ that define boolean value)
    };

  • these values would define an arbitrary collection of properties
  1. while values such as numbers, strings, and booleans are immutable and cannot be changed or altered, you can manipulate their properties within an object. the best way for me to describe it in my own words would be to say that an an object effectively creates a second layer to your code that allows you to adjust the relationship between these immutable properties. ie - you can change the references between these properties thus impacting the output value. the best example I saw of this was:
    let object1 = {value: 10};
    let object2 = object1;
    let object3 = {value: 10};

SECOND PART

  1. the short answer is that a string is immutable. as a primative language in JS, it cannot have new properties added, they wouldn’t be stored. the only way to impact a strong would be through the entry of a ‘method’ producing new values later in the code.

  2. a rest parameter is used when it’s necessary for a function to accept any number of arguments, or more refined in mathematical calculations … all the arguments. for example, in an array of numbers (ie - (4, 1, 9, -2);), the rest parameter can be used to extract the ‘max’ or largest number in the set (9), as opposed to using binary segmentation.

  3. serialization is when you convert data into a flat description, with the purpose of storing it for later use. you would use serialization to simplify this storage process, as opposed to just saving it to memory on the computer. it essentially allows easy recall by storing it on the web. this is done through JavaScript Object Notation (JSON). in the squirrelification example, you would use a serialization to save groups of data (ie - arrays of event data). instead of re-writing the entire event journal entry for weekend results, you can simplify it with a shorter JSON encoded string.

  4. above is a pretty accurate description of JSON - a data storage and communication format on the web for easy, simplified recall further down the code.

  5. while the JSON script resembles JS, there are a few restrictions to maintain simplification. restrictions include:

  • property names must be surrounded by double quotes
  • only simple data expressions are allowed
  • no function calls, bindings or anything with computation, or comments are allowed.
  • further, functions .stringify and .parse are used to convert data to and from this format.
1 Like

First Part:

1. Variable types such as strings and integers are only able to hold a single type of data.
2. Array and objects.
3. Are expressions that access a property of same value.
4. Null and undefined.
5. With dot and with square brackets.
6. Properties that contain function are called methods.
7. Objects are data structures that are capable of containing an arbitrary collection of properties.
8 Objects are special as they are able to hold as many different data types as we need.
9. Objects are defined as any other variable, with the value being a list contained can be changed.
10. The mutability of JavaScript objects mean that the value that contained can be changed.

Second part:

  1. They have built-in properties and they have a number of methods.
    2. Rest parameter is bound to an array containing all further arguments.
  2. JSON stand for JavaScript Object Notation. It is the format used to save objects and arrays for use on other webpages.
    4. They are quite similar, but with a few restrictions. One is allowed only to use “…” and not ‘…’ and no function call is allowed
1 Like
  1. Problem of storing multiple values. He needs a data structure that is capable of storing multiple values to keep all information organized.
  2. Arrays.
  3. Expressions that access a property of JavaScript values.
  4. Null and undefined.
  5. With dot and with square brackets
  6. Properties that contain function are called methods.
  7. Objects are data structures,
  8. They are able to hold different datatypes.
  9. Objects are defined as the value contained within braces.
  10. It means that values it holds can be changed.
    Second part:
  11. They are immutable.
  12. They allow function to allow any number or argument. We can add rest parameter by using three dots before the function last parameter.
  13. :))
  14. It means that data are converted into a flat description
  15. JavaScript Object Notation. It is widely used as a data storage and communication format on the Web
  16. 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

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?

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

What are properties in Javascript?

Which values do not have properties?

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

What are methods?

What are objects?

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

How do you define an object?

What can you say about the mutability of Javascript objects?

It was required a variable that can store multiple values.

Arrays and Objects

Properties are expressions that access a property of almost all JavaScript value.

values that do not have properties are the values null and undefined.

with a dot and a square bracket.

Properties in a value can be accessed using a dot and the literal name of the property. e.g. array.length
Properties can also be accessed using square brackets, with the expression between the brackets being evaluated to get the property name. e.g. array[“length”], Properties that contain functions for example the .toUpperCase(); method.

A method is a property that holds function for a type of value.

Values of the type object are arbitrary collections of properties,

A object can hold different datatypes.

An object is a collection of properties, and a property is an association between a name (or key) and a value. A property’s value can be a function, in which case the property is known as a method. In addition to objects that are predefined in the browser, you can define your own objects .

var myObject = {
Ranc: 10

Sam: 90

James:40

total : function () { return (10+90+40)}
}

is the characteristic of a datatype that allows it to be changed or modified after it has been declared.
objects are mutable.
strings, numbers, booleans are immutable.

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

What are rest parameters?

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

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

What is JSON?

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

because strings are immutable.

they represent an array with all arguments that will be included and are called by writing three dots before the functions name.

Serialization is the fact of storing your data structures to a transfer compatible format

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

In JSON you have to wrap keys and values with double quotes and can’t define methods

Only simple expressions are allowed in JSON. There are no functions, bindings, comments, or computations.

1 Like

1:The problems introduced in this chapter are storing different kinds of values within an object.

2: we could use an array or an object.

3: Properties are attributes of values like value. Length or value.keys.

4: undefined and null do not have properties.

5: we can either use the dot method or if we want to access a value assigned to an array, we could use square brackets like this:Object[valueName]

6: methods are commands which can either get information of a value like .length, u to change values properties like

7: objects are variables containing different data types as properties.

8: they solve the problem that different kind of data are possible to be stored within one variable.

9: by curly bracers and properties separated by “,” example: object{value,anotherValue};

10: Mutability means that the Object itself cannot be changed, but its containing values can.

SECOND PART:

1: because string values will not save them.

2: A function accepting any number of arguments.

3: YAY!

4: That means it is converted into a flat description.

5: JSON stands for JavaScript Object Notation and is a popular format of serialization. It is widely used as data storage and communication format on the web.

6: JSON is different as 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.

1 Like
  1. It introduces problems involving data sets, and more specifically it introduces the need for data structures capable of storing multiple values and datatypes. Variable types such as strings and integers are only able to hold a single type of data.

  2. Arrays and objects

  3. Properties are characteristics that define the values in a data structure.

  4. null and undefined

  5. Dot notation and square bracket notation. Dot notation only works on valid binding names(ie not numbers).

  6. Methods are properties that contain functions.

  7. Objects are arbitrary collections of properties.

  8. They can hold multiple different types of data at once.

  9. Binding names for objects follow the same rules we’ve already seen. The properties are declared as a list using commas inside of curly braces.

  10. Javascript objects can be modified, so they are mutable.

  11. String variables are primitive data types, not objects, therefore and are immutable.

  12. Rest parameters is a notation to allow for unlimited amount of given parameters in a function. The notation is 3 dots before the functions last parameter.

  13. Serialisation is converting data stored in memory into a flat description of what the data is, removing all unnecessary spaces, indentations, and new lines. It is useful when wanting to do things like save the date to a file or transfer it.

  14. JSON stands for Javascript Object Notation. It is a serialisation format widely used for data storage and communication.

  15. In JSON all property names need to be surrounded by double quotes. Only simple data expressions are allowed, so no function calls, bindings, or anything that involves computation. Also, comments are not 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?
In some cases we need big amount of data. In order to work better with these data and to better understand them we need to give them some structure. However using simple strings or integers are not practical for this. That’s why we use for example arrays.

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

3. What are properties in Javascript?
Properties are values of an object.

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

5. How can we access properties in a value (two ways)?
By dot or square brackets: value.x or value[x].

6. What are methods?
Methods are functions that are contained in properties. For example toUpperCase is a property that is also a function.

7. What are objects?
Objects are collections of properties. They are defined by braces {}.

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 group different properties (number, string, activity, boolean, etc.) into object (an array for example).

9. How do you define an object?
Object is defined by braces {} containing properties.

10. What can you say about the mutability of Javascript objects?
All types of values except objects are immutable. However object’s values are mutable. You can have 2 different values of object property at different time.

SECOND PART:

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

2. What are rest parameters?
Rest parameter is a parameter containing multiple arguments. It is defined by three dots before the parameter. For example we have an array called “numbers” which contains more arguments and in order to work with all arguments it is possible to use “…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 of data is taking the data stored in computer’s memory (typicaly data of objects and arrays) and convert them into format that can be stored and communicated with others. One of the most used formats is JSON.

5. What is JSON?
JSON (=JavaScript Object Notation) is a data format which is used for data serialisation.

6. What are the differences between JSON and the way programmers write objects in plain Javascript?
All property names in JSON has to be bordered with double quotes " " and only simple data are allowed (no functions etc.). JSON also does not contain 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? Variables such as strings and integers can only hold minimum data.
  2. What variable type can be used in order to solve the problem of storing multiple values? When storing multiple data values you can use [arrays].
  3. What are properties in Javascript? Properties are values built into the Javascript language.
  4. Which values do not have properties? Null and undefined have no properties.
  5. How can we access properties in a value (two ways)? two ways to access in a value is with Square brackets[] or the dot operator.
  6. What are methods? Methods are properties that hold function values that only work on values they belong to .push , .toUppercase.
  7. What are objects? objects can store values inside curly braces.
  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)? obects let us group several values into a single value.
  9. How do you define an object? Braces are used to create objects seperated by commas for each property named followed a colon and a value.
  10. What can you say about the mutability of Javascript objects? you can change properties causing object values to have a different content.

SECOND PART:

  1. Why can’t you add new properties to a string variable? String values are immutable and cant be changed.
  2. What are rest parameters? rest Parameters allow functions to accept any number of arguments using three dots … before the functions last parameter.
  3. (Feel free to skip the sub-chapter of Math object and Destructing) skip
  4. What is serialization and what is a use case of serialization of data? Serialization is the process of converting an object to a string which can be restored at a later time or transmitted over internet.
  5. What is JSON? Stands for JavaScript object notation, it is a serialization format.
  6. What are the differences between JSON and the way programmers write objects in plain Javascript? all properties have to be surrounded by “double quotes” no function calls are allowed or anything that requires computation.
1 Like
  1. He want a data that can store multiple values
    2.an array
    3.properties are the characteristics about the values in a data stucture.
    4.Null and undefined
    5.or with a dot or square brackets
    6.are properties that hold function values.
    7.objects are arbitrary collections of properties.
    8.they can hold as many different data types as we want.
    9.are defines as any other variable.
    10.mutability means that you can change the value that they contain(something for example you cannot do with strings)

second part

  1. a string is not an object so such values are immutable and cannot be changed.
    2.to write a function that accept any type of argument,you put 3 dots before the functions last parameter and is bound to an array that contain all further arguments.
  2. format that serialize the data which means convened it into a flat description.
    5.comments,function calls, bindings etc are not allowed in JSON.all the property names need to be surrounded in double quotes and simple data expressions
1 Like

PART I

  1. Strings and integers can only hold one value at a time, but the chapter introduces a need for some kind of “variable” that accepts more than a single value.
  2. Arrays can store multiple values.
  3. Properties are “aspects” or characteristics of values, such as length of an array or index of a value.
  4. Null and undefined
  5. a) using a dot and the literal name of the property. i.e. array.length
    b) using square brackets, with the expression between the brackets being evaluated to get the property name. i.e. array[“length”]
  6. They are properties that hold function values, working only on the value they belong to.
  7. They are data structures that are capable of containing a collection of properties.
  8. Objects are able to hold as many different data types as needed.
  9. An object is defined using braces and the properties inside it are separated by commas and usually consist of “key”: “value” pair.
  10. Objects can be modified, unlike other data types. Objects can have their properties changed, causing a single entry to have different values at distinct moments in time.

PART II

  1. String variables are the are reserved, because it is not an object but a primitive type of data.
  2. An array or json request
  3. Serialisation is converting information stored in memory into a flat description of what that info is. It is useful for saving and transferring data.
  4. It is a serialisation format widely used for data storage and communication and it means: JavaScript Object Notation
  5. In JSONs only simple data expressions are allowed and there can’t be function calls, comments, bindings, or anything that involves computation. All property names need to be surrounded in double quotes.
1 Like
  1. He needs to store values in a more compact form, accessing values sequentially like an array and in the same structure like a object.

  2. Arrays in a sequential form and Objects in the same structure

  3. Values wrapped in an object

  4. Null and undefined

  5. With . and [] value.x // value[x]

  6. Properties that contain functions.

  7. Objects are stored inside curly braces and have a set of properties, which are a key paired with a value. The key is either a binding name, number or string and same goes for the key.

  8. Objects can solve problems that involve correlation between variables.

  9. Braces are used to create objects. Properties inside the braces are separated by commas. Each property is named, follow by a colon and a value.

  10. Objects values can be modified by changing the properties


  1. Because strings are not mutable

  2. With rest parameters an arbitrary number of parameters can be passed and evaluated in a function. They can only be used as last parameter by putting three dots in front of the name and are bound to an array.

  3. It is a process to take a piece of information and format it in a convenient to share it with other programs or devices, it is useful when you want to send information over internet

  4. JSON is an acronym for Java Script Object Notation and is a popular data serialization format, used as a data storage and communication format on the Web.

  5. In JSON, all properties have to be surrounded by double quotes and there are only simple values allowed which don’t involve any computation. Also, there are also no comments allowed in the JSON format.

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?

Storing a sequence or list of values

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

Arrays -> [ values]

  1. What are properties in Javascript?

Values can have properties, like length of the string

  1. Which values do not have properties?

null

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

value.x or value[x], wereas the latter evaluates the expression x to get a property name

  1. What are methods?

Properties that contain functions are called methods

  1. What are objects?

Object are a collection of properties

  1. 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 hold an array of values with a boolean value aswell

  1. How do you define an object?

object = {
property, array [ ], boolean value
}

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

Most types of value are immutable, meaning the value they are holding cant be modified. Objects in contraire are mutable

SECOND PART:

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

Because strings belonged the the type of value that are immutable

  1. What are rest parameters?

Rest parameters screen all arguments of an array, do compute all arguments given

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

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

Data are tangles of memory addresses, without serialisation you would have to copy the entire content of its memory do deduct the information needed. Which isn’t really practial. Serialisation is converting data into flat description.

  1. What is JSON?

JavaScript Object Notation. It coverts the data, which is stored in different regions, in one flat description. Its widely used for datastorage

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

In JSON all property names have to be surrounded by double quotes and only simple data expression are allowed. Nothing that contains actual computation

1 Like
  • What problems that cannot be solved with variable types such as strings or integers? We cannot solve easily the storage of a sequence of numbers.

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

  • What are properties in Javascript? Properties are characteristics of a Javascript value.

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

  • How can we access properties in a value (two ways)? We can access but a dot value.property or square brackets value[property]

  • What are methods? are functions contained in a property

  • What are objects? are arbitrary collection 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)? I can store group of the basic value types together into a single value.

  • How do you define an object? By using braces as an expression with a list of properties separated by commas. Each property has a name followed by a colon and a value.

  • What can you say about the mutability of Javascript objects? Numbers, strings and booleans are immutable, they always remain the same. But we can change the properties of objects causing a single object value to a have different content at different times. There is a difference between having two references to the same object and having two different objects that contain the same properties.

  • Why can’t you add new properties to a string variable? because they arent object the language it doesnt store those properties.

  • What are rest parameters? is a syntax that allows a function an indefinite number of arguments.

  • What is JSON? JavaScript Object Notation is a data storage and communication format used in other languages beside JavaScript as well.

  • What is serialisation and what is a use case of serialisation of data?
    What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON Is a way to serialize the data to covert it to a flat description instead of using object containers that points to an address or specific location in the computer’s memory that actually contains the data.

1 Like
  1. The problem that strings and integers represent is that you have to change the values back to integers and they can not be stored and easily accessed like arrays and objects.
    2.Arrays enable you to store multiple properties.
  2. Properties are the values in the data structure.
  3. Null and undefined do not have properties.
  4. You can access a property with dot notation (.x) or bracket notation([x]).
  5. Methods are properties that contain functions, they only work on the value belonging to them, for example .pop(removes an element) and .push(adds an element).
  6. /*
    Unlike arrays, objects comprise boolean values and the lists of values. Objects are arbitrary collections of properties.
    */
    let day1 = {
    squirrel:false,
    events: [“work”, “touched tree”, “pizza”, “jerked off”, “worked out”]
    };
    console.log(day1.squirrel);
  7. Objects are like an octopus, multiple tentacles that enable you to do multiple things, where as the other type values have a set protocol.
  8. var obj1= {
    a:1,
    b:2,
    };
  9. Objects can change their values over time, an integer or string is set in stone. Some objects are said to have the same identity.

PART 2:

  1. Strings are immutable, unlike objects.
  2. A rest parameter(…) , these parameters are bound an array containing all further arguments.
    3.SKIP
  3. Serialization is the act of converting the data into a flat description. It is useful when you want to save the data or transfer it.
  4. JSON is Javascript Object Notation, a widely used serialisation format used in storage and communication.
  5. JSON does not have comments and has double quotes for all notation.
2 Likes
  1. For the purpose of storing a large amount of data though data

  2. Arrays can store a multitude of values.

  3. Properties are values found inside an object.

  4. undefined and null.

  5. With a dot or square brackets. The dot is used top fetch the property of the value named behind the dot. The square brackets evaluates the expression between brackets.

  6. Methods are properties that contain functions.

  7. Objects is a variable that holds values (such as properties and methods) acting like a unit.

  8. Object can store values of different types as integers, booleans, strings and arrays.

  9. {}

  10. Objects can be modified. Objects can have their properties changed, which causes a single value to have different value at a certain moment in time.

Part 2

  1. A string variable is not an object.

  2. Rest parameters let users represent an unlimited number of arguments as an array.

  3. Serealization means converting data into a flat description which makes it convenient to save data to a file.

  4. JSON stands for Java Script Object Notation. It is a popular data serialization format, used as a data storage and communication format on the Web.

  5. In JSON, all property names must be surrounded by double quotes and only simple expressions are allowed. No function calls, bindings, comments, or any computation.

1 Like

PART 1

  1. The problems introduced in this sub-chapter are that a data structure is needed that is capable of storing multiple datatypes and values.

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

  3. Properties in Javascript define characteristics of the values in the data structure.

  4. Null and undefined are values that do not have properties.

  5. The two main ways to access properties in JavaScript are with a dot and with
    square brackets.

  6. Methods are properties that contain functions.

  7. Objects are created using braces to contain a lost of value pairs that a separated by commas.

  8. Objects are special because they can contain multiple different datatypes.

  9. Objects are defined with list value( the list) contained within braces. They are arbitrary collections of properties.

  10. Javascript object mutability means the values can be changed.

1 Like

Part 1:

  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?
    Since Jacques has started to keep a daily log, strings or integers are unable to store information about everything he does in a given day, and whether he changed form.

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

  3. What are properties in Javascript?
    They are expressions that access a property of some value. Eg., myString.length in which the length property of myString gets the length of the string.

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

  5. How can we access properties in a value (two ways)?
    They can be accessed with a dot and with square brackets, eg. array.length and array[“length”].

  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)?
    Objects are able to store an array of properties, separated by commas, and each property has a name followed by a colon and a value.

  9. How do you define an object?
    An object can be defined by using braces as an expression.

  10. What can you say about the mutability of Javascript objects?
    Objects properties can be changed, causing a single object value to have different content at different times.

Part 2:

  1. Why can’t you add new properties to a string variable?
    A string variable is not an object, thus is immutable and cannot be changed.

  2. What are rest parameters?
    Rest parameter is a function’s last parameter with three-dot notation put before the parameter, thus enabling a function to accept any 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 the conversion of data file into a flat description as opposed to entire computer memory along with the address of the value one is interested in. One use case of serialisation of data is when you want to save data in a file for later or send it to another computer over the network.

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

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    a. All property names have to be surrounded by double quotes,
    b. Only simple data expressions are allowed—no function calls, bindings, or anything that involves actual computation.
    c. Comments are not allowed in JSON.

2 Likes
  1. Strings and integers can only store one value; what is required here is a data type capable of storing multiple values.
  2. Objects can store multiple values of different types. Arrays are a type of obect that can store multiple values of the same type.
  3. Properties define a characteristic of a value in JavaScript, eg the length of a string.
  4. Null and undefined do not have properties.
  5. Properties are accessed with a dot or square brackets.
  6. Methods are properties of values that contain a function.
  7. Objects are values made up of an arbitrary collection of properties.
  8. Objects can contain different types of values in a single data structure. This allows an object to be uniquely identified, to be equated with another object, and for its values to be changed (ie it has mutability).
  9. An object can be defined using braces as an expression. Inside the braces, there is a list of properties separated by commas.
  10. Unlike other values such as strings, numbers and Booleans, which are immutable, the value of an object can be modified. Its properties can be changed so as to cause a single object content to have different content at different times.
    SECOND PART
  11. String variables have fixed properties that cannot be changed, unlike objects.
  12. Rest parameters allow a function to accept any number of arguments and are denoted by three dots before the function’s last parameter.
  13. Ok
  14. Serialisation is the conversion of data to a flat description of what it is, so that it can be saved to a file or tranferred across a network.
  15. JSON is JavaScript Object Notation, which is widely used as a data storage and communication format on the Web, even in languages other than JavaScript.
  16. In JSON all property names need to ne surrounded by double quotes and only simple data expressions are allowed.
2 Likes