Data Structures (Arrays and Objects) - Reading Assignment

Welcome to the discussion about the reading assignment about data structures.

Leave your answers to the questions below in this thread. If you have any questions or you want to discuss something connected to the assignment feel free to do it in this thread as well, but please everything to the topic.

  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?
  3. What are properties in Javascript?
  4. Which values do not have properties?
  5. How can we access properties in a value (two ways)?
  6. What are methods?
  7. What are objects?
  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)?
  9. How do you define an object?
  10. What can you say about the mutability of Javascript objects?

SECOND PART:

  1. Why can’t you add new properties to a string variable?
  2. What are rest parameters?
  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?
  5. What is JSON?
  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
34 Likes

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?
Variable types such as strings and integers are only able to hold a single type of data. What our friend needs is a data structure that is capable of storing multiple values and datatypes in order to keep all of the information organised.

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

3. What are properties in Javascript?
Most Javascript values have properties. These define some characteristic about the values in a data structure, such as the length of an array or the index of a value.

4. Which values do not have properties?
Null and undefined are the exceptions that do not have properties.

5. How can we access properties in a value (two ways)?
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”]

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

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 special as they are able to hold as many different datatypes as we need.

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

10. What can you say about the mutability of Javascript objects?
The mutability of Javascript objects means that the values they contained can be changed. This is different to other datatypes such as strings, which will always keep the same value it was defined with.

SECOND PART:

1. Why can’t you add new properties to a string variable?
A string is not an object but a primitive type, so they are immutable.

2. What are rest parameters?
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. What is serialisation and what is a use case of serialisation of data?
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. What is JSON?
JavaScript Object Notation is a serialisation format widely used for data storage and communication.

5. What are the differences between JSON and the way programmers write objects in plain Javascript?
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.

37 Likes

First Part:

  1. It was required a variable that can store multiple values.
  2. Arrays and Objects
  3. “are expressions that access a property of some value”
  4. null and undefined
  5. e.g. value.x // value[x]
  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 considered collections of properties, inside object the user can store different value types.
  8. Object can store values of different types as integers, booleans, strings and arrays.
  9. e.g. “var ball = {color: “red”, size = 10}”
  10. Users can change objects properties. Also: “there is a difference between having two references to the same object and having two different objects that contain the same properties”

Second Part:

  1. Because string variables are immutable
  2. It is the use of any number of arguments in a function.
  3. ok :slight_smile:
  4. “Is the process whereby an object or data structure is translated into a format suitable for transfer over a network or storage” // “convert into a flat description”.
  5. Json is a popular serialization format. “It is widely used as a data storage and communication format on the Web”
  6. Properties should also be written inside double quotes. JSON only allow simple values expression like strings, numbers, arrays and booleans. “So no function calls, bindings, or anything that involves actual computation.”
8 Likes
  1. Read the sub-chapter called The where squirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
  2. Everyday Jacques needs to keep a log of all the things he does. Then, he needs to push that list into a record containing every other day he has recorded. A simple string cannot describe the activities as each index in the string is only a character. Also, variables may change, but are a single value at a given moment in time. A simple integer cannot provide a change in data per index. This log requires an array of information, to be stored for a given day, or a collection of strings and integers.

  3. What variable type can be used in order to solve the problem of storing multiple values?
  4. An array can be used to store strings and integers at multiple index positions. Arrays are stored within square brackets, separated by commas.

    For example if he wanted to document what he did through the day he could start with the array.

    let day1 = [ "Home" ];
    console.log(day1);
    // -> Home
    

    Then a push property can be invoked through the day as he encounters places.

    day1.push("School");
    day1.push("Park");
    day1.push("Mall");
    

    If he wanted to return all the values for the day

    console.log(day1);
    // -> Home
    // -> School
    // -> Park
    // -> Mall
    

    If he wanted to know what was the second location he was at that day (the first place from home)

    console.log(day1[1]);
    // -> School
    
  5. What are properties in Javascript?
  6. Properties are expressions that access a property of almost all JavaScript value.

  7. Which values do not have properties?
  8. Exceptions to JavaScript values that do not have properties are the values null and undefined.

  9. How can we access properties in a value (two ways)?
  10. The two main ways to access a value’s property are with a dot and a square bracket.

  11. What are methods?
  12. A method is a property that holds function for a type of value. For example the
    .push method adds values to the end of an array.

  13. What are objects?
  14. Objects are values of arbitrary collections of properties.

  15. 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)?
  16. Object tie different properties together to express a single condition. This allows programmers to better represent how a system should behave.

  17. How do you define an object?
  18. 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.

  19. What can you say about the mutability of Javascript objects?
  20. Unlike numbers, strings and Booleans, which are immutable values, objects can be moddified. Objects can have their properties changed, causing a single value to have different value at a certain moment in time.

Second Part:

  1. Why can't you add new properties to a string variable?
  2. Since values of type string, number and Boolean are not objects, even if you mention a new property for them JavaScript will not store it. String, number and boolians have build in properties. slice for example is a build in property that cuts the strings at a specified start and ending index position. indexOf searches for the index of a string. trim removes whitespaces.

  3. What are rest parameters?
  4. Rest parameters are bound to an array,which contains all further arguments. This allows functions to allow any number of arguments. To add a rest parameter use three dots before the function’s last parameter. For example:

    let numbers = [5, 1, 7];
    console.log(max(...numbers));
    // → 7 
    
  5. (Feel free to skip the sub-chapter of Math object and Destructing)
  6. What is serialisation and what is a use case of serialisation of data?
  7. Objects and arrays are stored as bits holding addresses. These objects can be serialized into a data management notation, suitable for digital communications.

  8. What is JSON?
  9. JSON stands for JavaScript Object Notation, a standard used in data storage and communication on the web.

  10. What are the differences between JSON and the way programmers write objects in plain Javascript?
  11. Only simple expressions are allowed in JSON. There are no functions, bindings, comments, or computations.

16 Likes

FIRST PART:

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 have yet to handle large sets of data. Arrays and the Data Structures that bring a perspective and corresponding tools on how to percieve and relate to data.

What variable type can be used in order to solve the problem of storing multiple values?
- Arrays are used for data sets (Arrays), where the dot operator allows connection to Objects and the Arrays of values within them (Data Structures).

What are properties in Javascript?
- All values have properties built into the nature of the structure of the language.

Which values do not have properties?
- Only the nonvalues of “null” and “undefined” are without properties.

How can we access properties in a value (two ways)?
- One example is the dot operator (myString.length). This returns the length of the string named myString.
- The second way would be to use the property within square brackets (myString[“length”]).

	let sequence = [1,2,3,4,5];
	console.log(sequence.length);
	console.log(sequence["length"]+1);
	//Output--> 5
	//Output--> 6

What are methods?
- A method is a kind of a property like the length example above, however the property holds a function itself. Due to the nature of the structure of the language, every string has “toUpperCase” property which returns a copy of the string as ALL CAPITALIZED.

	The example from the book:

		let doh = "Doh";
		console.log(typeof doh.toUpperCase);
		// → function
		console.log(doh.toUpperCase());
		// → DOH

What are objects?
- Objects are groupings of data. They are defined within curly braces {} by sets of values given in the format of (name : “Ivan”, rating : 100,…). The language also has built-in functions for these objects. Object.keys(); for example, gives the property names that are associated with the object passed into it.

		let anObject = {Name: "Ivan", Rating:100};
		console.log(anObject);
		console.log(Object.keys(anObject));
		//--> {Name: "Ivan", Rating: 100}

		//--> ["Name", "Rating"]

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)?
- The previous types (such as integer, string, array, boolean etc) are immutable values but are not objects and therefore structually will not have the same properties. This introduces the ability to equate two objects which is to equate their identity, not simply their value. This ability to uniquely identify objects allows for the values to be mutable or changeable, as the information is referenced through the object itself not directly to the values.

How do you define an object?
- See the previous question “What are objects?”.

What can you say about the mutability of Javascript objects?
- This seems to allow for much greater flexibility.

SECOND PART:

Why can’t you add new properties to a string variable?
- The data type of string is not an object and does not allow for additional properties beyond that which is language based.

What are rest parameters?
- Rest parameters accept any number of arguments. The notation includes the elipsis (…) to represent an array of all arguments to be included.

(Feel free to skip the sub-chapter of Math object and Destructing)
Skipped! :slight_smile:

What is serialization and what is a use case of serialization of data?
- Serialization converts data into a flat description of itself. This allows us to use JSON notation to convert data between data types, from string to the value it holds and vice versa.

What is JSON?
- JavaScript Object Notation is a notation for data storage and communication.

What are the differences between JSON and the way programmers write objects in plain Javascript?
- JSON requires double " " quotes for all property names not single quotes ’ '.

6 Likes

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? Save several values or data in the same variable
What variable type can be used in order to solve the problem of storing multiple values? Arrays
What are properties in Javascript? Characteristics
Which values do not have properties? NULL
How can we access properties in a value (two ways)? value.x and value[x]
What are methods? Part of a program that can be inherited
What are objects? object is a unit within a program
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? var obj = new Object();
What can you say about the mutability of Javascript objects? It can`t change
SECOND PART:

Why can’t you add new properties to a string variable? the are reserved
What are rest parameters? An array /json request
(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? type of array
What are the differences between JSON and the way programmers write objects in plain Javascript?JSON requires double quote

1 Like

1. A variable type is needed that can store multiple values and make them easy to access.

2. Array

3. Properties are the values associated with a JavaScript object.

4. null, undefined

5. objectName.property or objectName["property"]

6. Properties that contain functions.

7. A JavaScript object is a collection of unordered properties.

8. A object can hold different datatypes.

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

10. Javascript objects are not immutable. Their properties can be changed causing a single object value to have different content at different times.

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

4. Serialization is the process of converting data structures or a object state into a format that can be stored. It is used to save data in a file or send it to another computer over the network.

5. JSON (JavaScript Object Notation) is a popular serialization format.

6. Only simple data expressions are allowed and all property names have to be surrounded by double quotes.

1 Like

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

For the purpose of storing a bunch of data, it is much more practical to store it in a data structure.

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

Arrays like so:
let myArray = [5, 2, 7, 9];

3. What are properties in Javascript?

Properties are characteristics of values in a data structure. for example:

let myArr = [4, 2, 5, 7, 3]; 
console.log(myArr.length);

in this case: myArr.length is an expression which points to myArr (the array i declared) and the .length (is the method used to get the maximum number of indexes within myArr).

4. Which values do not have properties?

Null and undefined.

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

value.x
value[x]

6. What are methods?

Properties that contain functions for example the .toUpperCase(); method

7. What are objects?

data structures like objects are used to store 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 need to store different data types.

9. How do you define an object?

one declares a variable but the difference is that the value of that variable has to be inside curly braces {}, inside the curly braces one must separate the properties using commas, each of the properties should be given a name followed by a colon and a value. example

let myObj = {
  horse: false,
  events: ["gym", "eat", "coding", "eat", "eat again"]
};

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

mutability as the name suggest 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.


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 arguments that will be included and are called by writing three dots before the functions name.

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

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

4. What is JSON?

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

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

JSON looks the almost the same as plain JavaScript but with the following restrinctions:

    1. All property names must be surrounded by double quotes, only simple data expressions are allowed.
    1. no function calls
    1. no bindings
    1. anything that involves actual computation
    1. comments are not allowed.

First part:
1- Storing values in a row cannot be solved by data types as strings or integers
2- Arrays are JS data structures made for storing values in a row
3- Properties are values defined inside an object
4- null and undefined don’t have any properties or method
5- You can access properties by a dot or square brackets. ie: data.prop , data[‘prop’]
6- Methods are functions defined inside an object
7- Objects are JS data structures made for being used as associative arrays or for defining our own customized data structures with values and functionalities binded
8- Objects can solve the problem you have when you need a more complex data storing than primitive types supply you
9- Object for storing log and input date: let obj = { log: [1,2,3], date: Date.now() }
10- Mutability is the fact of changing the value from a defined binding. A mutability way of developing may get your code very complex if you are not careful

Second part:
1- You can’t add new properties to a string because strings are JS primitive values and they are defined by JS interpreter by own
2- Rest paremeters can be accepted by a function which don’t have any specific number of parameters defined
3- Ok, but I read it xD
4- Serialization is the fact of storing your data structures to a transfer compatible format
5- JSON is the standard for serializing objects in JS. It extends for Java Script Object Notation
6- In JSON you have to wrap keys and values with double quotes and can’t define methods

1 Like

** First Part **

1- variables allow us to store only one information. In this case we need to Store more than one information and that can
be easily found ==> data structure.

2- Arrays

3- properties define some characteristic about the values in a data structure, ex: array.length

4- Null and undefined do not have properties

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

6- Both string and array objects contain, in addition to the length property, a number of properties that hold
function values. Properties that contain functions are generally called methods of the value they belong to.

7- Objects are data structures that are capable of containing an arbitrary collection of properties.

8- Objects are able to hold many different datatypes.

9- the same way with define classica variable + the value being a list contained within braces ex: let myObject = {value: 10, item= “example”}

10 - The mutability of Javascript objects means that the values they contained can be changed. This is different to other datatypes such as strings, which will always keep the same value it was defined with.

** Second Part **

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.

4- Serialisation is the fact to convert data stored in memory into a flat description.

5- JavaScript Object Notation is a serialisation format widely used for data storage and communication.

6- 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. 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 has to write many variables every day to track if one of them is the cause for his transformation. His best approach is to solve it is the store the variable types into a data set, such as 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 values. Their names are normally strings when associated with objects or whole numbers when associated with arrays.
  4. Which values do not have properties?
    undefined and null
  5. How can we access properties in a value (two ways)?
    With a dot notation proceeding the name or as a string inside square brackets.
  6. What are methods?
    Method is a property that is a function.
  7. What are objects?
    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. 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 solve problems that involve correlation between variables.
  9. How do you define an object?
    Insert it inside curly braces.
  10. What can you say about the mutability of Javascript objects?
    You can change the properties of objects but be careful that if you have another variable that was assigned by another object as if to create a copy. So if that ‘duplicated’ object is changed, then the original object will be changed as well because the copy object actually is referencing to the original object.

Part Two

  1. Why can’t you add new properties to a string variable?
    Because a string variable is not an object.
  2. What are rest parameters?
    It is a parameter inside a the function’s parenthesis and is proceeded with ellipsis ‘…’ and it spreads the argument into an array.
  3. What is serialisation and what is a use case of serialisation of data?
    The process whereby an object or data structure is translated into a format suitable for transferal over a network, or storage.
  4. What is JSON?
    JSON stands for JavaScript Object Notation and is used for data storage and communication format on the internet.
  5. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON’s property names have to be inside double quotes. There is no logic inside the file such as function calls and bindings.
1 Like
  1. Collection of data which requires something more verstile than String or Integer to store it.

  2. Arrays

  3. Property is a key value pair related to a data type or object.

  4. null and undefined do not have properties.

  5. Properties can be accessed with dot and with square brackets. e.g. Math.min and in case of array let age = [15, 18, 10, 6], second index value can be accessed as age[1]

  6. Methods are the properties which hold the function values. It allows to perform some operation on the value.

  7. Object is collection of propeties holding state (data) and may or may not contain behaviour (methods) of that Object.

  8. We can create Object as we want and can defined the behaviour as needed to modify their state. But primitive types are predefined to store only data value.

  9. Object can be defined as binding and its value in braces e.g. let person = {name: “John”, age: 21};

  10. Objects are mutable as their values can be altered. But primitives are not.

Second set of questions

  1. We can’t add properties to primitive data types (string, number and Boolean) as they are not treated as Objects.

  2. Passing a Rest paramenter to a function as argument allows us to pass infinite number of arguments as array. Rest parameter has a specific syntax e.g. argument prefix by three dots (… theArgs) function calPercentage(percentage, …theArgs)

  3. Serialisation is a process of converting the state of Object into flat data (bits) so that it can be transferred over network

  4. JSON- JavaScript Object Notation used for data storage and sending and receiving data over network for Web applications.

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

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? When working with a collection of data that includes multiple variables and data types, it requires a more elegant solution for representing that information in our machine’s memory than what strings and numbers can afford.

2. What variable type can be used in order to solve the problem of storing multiple values? An array is an example of a variable type that can store multiple values.

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

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

5. How can we access properties in a value (two ways)? The dot notation is used if the word after the dot is the literal name of the property that you want to access. The square brackets notation is used if you want an expression to be evaluated first before deriving its property name that you want to access.

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

7. What are objects? Values of type object 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)? When you want to group data together and the data itself is unordered and of varying data types then an object is preferred.

9. How do you define an object? One way to define an object is by using braces as an expression.

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.

PART 2

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 allows us to represent any number of arguments as an array.

4. What is serialisation and what is a use case of serialisation of data? Serialisation is the conversion of data into a flat description, which is useful for saving and sending data.

5. What is JSON? JSON stands for JavaScript Object Notation and is a popular serialisation format 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? JSON requires all property names to be surrounded by double quotes and only simple data expressions are allowed meaning no comments, function calls, binds or anything that involves actual computation are allowed.

1 Like

1- He needs a data structure to store different information.
2- Arrays can store multiple values of a kind like strings or numbers …
3- almost all values in javascript have properties which you can access by putting a dot after the value like Math.max.
4-null and undefined.
5- The two main ways to access properties in JavaScript are with a dot and with square brackets. Both value.x and value[x] access a property on value.
6-Properties that contain functions are generally called methods of the value they belong to, as in “toUpperCase” is a method of a string.
7-Values of the type object are arbitrary collections of properties.They can store different kinds of values and properties.for example:
let day1 = {
squirrel: false,
events: [“work”, “touched tree”, “pizza”, “running”]
};
8- Objects can store different kinds of values in one value while for example arrays only can store one type of value like numbers or strings.
9- Objects can store different kinds of values in one values by using braces and Inside the braces, there is a list of properties separated by commas. Each property has a name followed by a colon and a value.
10-object values can be modified. The types of values such as numbers, strings, and Booleans, are all immutable.it is impossible to change values of those types. Objects work differently. You can change their properties, causing a single object value to have different content at different times.
Second part :
1- In javascript strings are immutable and can’t be changed at all.
2- If a function can accept any number of arguments by using 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- Serialization means that data like objects or arrays are converted into a flat description in order to be saved in a file or to be sent to another computer over the network.
4- A popular serialization format is called JSON, 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- 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 and Comments are not allowed in JSON.

PART ONE:

1.The irregular occurrences of the transformation make him suspect that they might be triggered by something but he doesnt know what is actually trigger. There is to many factors that can influence him. He needs more advanced methode if he wants to solve his problem.
2.Objects allow us to group values—including other objects—to build more complex
structures. We can also use arrays for smaller projects.
3.Expressions that access a properly of some value for exmaple myString.length, Math.max. They does not pass any arguments, the function somehow has access to the string.
4…The exceptions are null andundefined.
5. using dot and name of teh property or using square brackets.
6,Properties that contain functions are generally called methods of the value
they belong to, as in “toUpperCase is a method of a string”.
7. You may think of objects as octopuses with any number
of tentacles, each of which has a name tattooed on it.
8.Objects are bigger and more complex
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.Object values can be modified

PART TWO:

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.
2,The way that functon can use infinte number of parameters.
3.
4.That means it is converted into a flat description. 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. It is just format popular for serialization.
6.Only simple expressions are allowed in JSON. There are no functions, bindings, comments, or computations.

  1. Create a data structure to store sequences of information/values
  2. An array
  3. Variables access a property of a value
  4. Null and undefined
  5. With a dot (fetches the property of value named behind the dot) or square brackets (evaluates the expression between between brackets)
  6. Methods (of the value they belong to) are properties that contain functions
  7. Objects are values that are arbitrary collections of properties
  8. With objects different kind of properties can be created, added and removed as we please
  9. Inside braces you give a list of properties separated by commas. Each property is written as a name, followed by a colon and an expression that provides a value for the property.
  10. Javascript objects values can be modified by changing the properties

SECOND PART

  1. Because strings are immutable, new properties aren’t stored
  2. Rest parameters can let us represent an unlimited number of arguments as an array
  3. /
  4. Serialization is converting an object’s state to a string, that way it becomes able to be distributed to another computer, stored and retrieved.
  5. JSON = Javascript Object Notation: it’s standard text format to present, transport and store data
  6. JSON is a text only format to communicate between server and client, where as Javascript is a programming language interpreted by browsers
1 Like
  1. He needs to store different data sets which are grouped in a special way and are dynamic.

  2. Arrays and objects.

  3. They access a property of some value.

  4. null and undefined.

  5. value.x or value[x]

  6. Properties that contain functions are generally called methods of the value they belong to.

  7. Objects are data structures that are capable of containing an arbitrary collection of properties.

  8. Objects can store different kinds of values in one value while for example arrays only can store one type of value like numbers or strings.

  9. With braces to contain a list key/value pairs separated by a comma.


  1. Strings are immutable.

  2. The rest parameter is bound to an array containing all further arguments.

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

  4. JavaScript Object Notation. It is widely used as a data storage and communication format on the Web, even in languages other than JavaScript.

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

We need a way to store values in a more compact form, accessing values sequentially like an array and in the same structure like a object.

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

Arrays in a sequential form and Objects in the same structure

What are properties in Javascript?

Values wrapped in an object

Which values do not have properties?

Null and undefined

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

With . and []

What are methods?

Functions wrapped in an object

What are objects?

A variable that hold values like properties and methods, and acting like a unit.

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

Hold different values in the same variable in a convenient way

How do you define an object?

The easy way is using {}

What can you say about the mutability of Javascript objects?

You can define and delete a property and a method on a object when you want, even after define it

Second part

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

Because strings are not mutable

What are rest parameters?

Arbitrary parameters that a function takes and put into an array

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

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

What is JSON?

A standard format to share information as JavaScript like-objects

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

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?

It introduces the problem of storing multiple data types in the same array element. This could be names of things/activities (strings), numbers of things or dates and times (integers) and status of certain properties (boolean values).

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

Objects can be used to store multiple values in a single object array element.

What are properties in Javascript?

A property is a value stored in an object.

Which values do not have properties?

The null and undefined values both do not have any properties.

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

We can either use dot notation (value.length) or using square brackets (value[“length”]).

What are methods?

A method is similar to a property in that it is stored within an object, but, it is more similar to a function in the way it performs.

What are objects?

An object is an arbitrary collection of values (properties and methods).

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

An object can hold all the different variable types if needed and all values are able to be changed at will.

How do you define an object?

Taken from eloquent javascript: let object1 = {value: 10};

What can you say about the mutability of Javascript objects?

Javascript objects are completely mutable as they are made up of different variables with assigned content.

SECOND PART

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

Because a string variable is not an object and are considered immutable.

What are rest parameters?

Its a kind of dynamic parameter that can take an array with no fixed sized.

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

Serialisation re-formats a program to give it a flat description. This allows us to transfer our program without needing a carbon copy of our entire computer memory to use it.

What is JSON?

JSON stands for Javascript Object Notation and is a popular data storage format.

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

In JSON, everything is put between double quotes except the basic data types (boolean, integers) and no function calls or bindings are allowed.

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 author needed to store different date all related and in an organized log like method to allow easy retrieval and analysis as a whole.

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

Objects where used for storing multiple values.

What are properties in Javascript?

Properties are variables within an object.

Which values do not have properties?

Null and Undefined.

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

You can access properties using . notation such as st.length, or square brackets such as st[x]

What are methods?

Methods are functions within and object, they usually act on the object itself but not necessarily.

What are objects?

Objects is a data structure abstraction usually representing that combines variables in the form of properties and functions in the form of functions to handle and manipulate the object in general.

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 solve problems that mimics a real world happening and allows the related variables and methods representing different data types to be used and called to follow , record or control the real world instance.

How do you define an object?

Objects are defined using curly braces.

What can you say about the mutability of Javascript objects?

Objects are mutable.

SECOND PART:

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

Because a string is not an object.

What are rest parameters?

Rest parameters are three dots that represent an arbitrary number of parameters as the function input.

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

Serialization is the conversion of an object to a string of characters or bytes, the use case is to transmit the object across the network or store it or replicate it to another similar is slightly different object.

What is JSON?

JSON represents JavaScript Object Notation, it is a way to store information such as structures, arrays or objects in a lightweight, human readable format that is easy to parse.

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

Only data and names are allowed in JSON, with javascript more complex methods and functions can be included in an object.

3 Likes