Data Structures (Arrays and Objects) - Reading Assignment

Hi all,
Hi all, as always excuse my poor english!!1 Please let me know if youre reding this so I dont feel so lonely in the process of becoming full time crypto

  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?
    It introduces a problem where one guy transforms himself into a squirrel, so the guy intends to keep a log or a journal of his activities during the day, so later on he can check the log and try to find out why is he transforming.
  2. What variable type can be used in order to solve the problem of storing multiple values?
    

Objects and arrays!!
3. What are properties in Javascript?
Properties are characteristics of an object, often describing attributes associated with a data structure.
4. Which values do not have properties?
null and undefined
5. How can we access properties in a value (two ways)?
The two main ways to access properties in JavaScript are with a dot and withsquare brackets. Bothvalue.xandvalue[x]access a property onvalue (i just copy and pasted this answer)
6. What are methods?
JavaScript methods are actions that can be performed on objects
7. What are objects?
objects in JavaScript may be defined as an unordered collection of related data, of primitive or reference types, in the form of “key: value” pairs.
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)?
mm…
9. How do you define an object?
here’s an expample:
let escuela = {
name : “Escuela E653”,
location : “Concepcion”,
established : “1983”
}
10. What can you say about the mutability of Javascript objects?
The types of values discussed in earlier chapters of the book, such as numbers, strings, and Booleans, are all immutable… but for objects, that is not the case , you can change their properties :slight_smile:

SECOND PART:

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

Bacause they are not objects, you can try to put new properties to a string, but they will not be stored, and JS deosnt complain, so its kind of dangerous.
2. What are rest parameters?
it is the “…” that is used to denote when a function can have any number of arguments. You can also use the rest parameters when calling a function, to tell the function that it should perform the function in all the elements of the array, one by one
3. (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?
    

I dont know … we didnt cover that in the reading
5. What is JSON?
is a lightweight data-interchange format. It is easy for humans to read and write. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others.
6. 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, oranything that involves actual computation. Comments are not allowed inJSON

1 Like

PART 1

  1. This chapter deals with situations where you have multiple values that you’d like to store within one binding.
  2. You can use the array type variable.
  3. Properties can simply be the individual elements within an array. They can also be some aspects of a string or an object…for example, the length of a string is a type of property of that string. The “max” function is also a property of the Math object in JS.
  4. null and undefined
  5. You can use the . or index square brackets []. If we assume x is some particular property, it can be accessed via value.x or by value[x].
  6. Methods are kind of like a function that you can use to manipulate arrays and objects. For example, array.includes(x) is useful when you want to single out a scenario where x exists within an array. array.push is another method, which lets you add elements into an array.
  7. Objects are a collection of values and arrays. You can store multiple types of values inside an object, such as strings, booleans, numbers, etc.
  8. Objects let you manipulate all of those value types within a single binding.
  9. An objects gets defined by using curly braces after a binding declaration.
  10. Objects are different from strings in that they can be modified. The properties within them can be changed, as opposed to individual characters within a string, which cannot. Also, two separate objects live truly separate lives, even if the values/properties they hold are the same.

PART 2

  1. A string variable is immutable. It doesn’t have any tentacles attaching to anything, and is itself a kind of primitive foundational value.
  2. Rest parameters allow us to make functions that can take an endless amount of arguments. They also allow us to call all the properties of an array and pass them individually through a function, as arguments.
  3. Serialization is the process of taking all the addresses of the computer memory that describe an object and all its properties/values, and boiling it down to one single description. This is necessary if you want to send your program data to another computer.
  4. JSON is one type of file format that allows for a condensation of the convoluted memory storing an object with all its properties and values.
  5. in JSON all properties need to be surrounded by double quotes. The JSON notation also cant have any function calls or any form of computation within it.
2 Likes

Hi @Rob_McCourt,
Human is the Object.
name, age, hobbies are properties.

Hi @javier_ortiz_mir, Do not worry my friend. We are here with you and your answer is pretty well worded too. Need not feel lonely :smiley:

It’s basically converting your data into the JSON format. This process is called serialization.

Hope this helps :slight_smile:

1 Like
  1. He wants to store more than a single data type and different values.
  2. Arrays area variable that can store multiple values.
  3. A JavaScript property is a characteristic of an object, often describing attributes associated with a data structure.
  4. Null and undefined.
  5. Properties are accessed using value.prop or value[“prop”].
  6. Methods are functions that live in properties and (usually) act on the value they are a property of.
  7. Objects may be defined as an unordered collection of related data of primitive or reference types in the form of key-value pairs. A JavaScript object is an entity having state and behavior (properties and method).
  8. Objects can hold different data types.
  9. Objects are variables too. But objects can contain many values.
    example:var person = {firstName:“John”, lastName:“Doe”, age:50, eyeColor:“blue”};
  10. The mutability of Javascript objects means that the values they contain can be changed.

Second part:

  1. Because a string is a primitive type which is immutable.
  2. Rest parameter is an improved way to handle function parameter, allowing us to more easily handle various input as parameters in a function. The rest parameter syntax allows us to represent an indefinite number of arguments as an array.
  3. Serialisation is converting data stored in memory into a flat description of what that data is. It is useful for when we want to do things like saving the data to a file or transferring it to another computer on a network.
  4. JavaScript object notation is a serialisation format widely used for data storage and communication.
  5. All property names need to be surrounded in double-quotes and only simple data expressions are allowed. So no function calls, bindings, or anything that involves actual computation. Also, comments are not allowed in JSON.
1 Like

1. What problems does the weresquirrel chapter introduce that cannot be solved with variable types such as strings or integers?
A data structure is required that is capable of storing multiple values and datatypes.

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

3. What are properties in JavaScript?
A property in JavaScript is a specific characteristic of a value (ex.: largest in a list of numbers: Math.max).

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

5. How can we access properties in a value?
Two ways:

  1. With a dot:
    value.x gets the property of value named “x”.
  2. With square brackets:
    value[x] evaluates the expression x and uses the result, converted to a string, as the property name.

6. What are methods?
Methods are functions that live in properties and (usually) act on the value they are a property of.

7. What are objects?
Values of the 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?
Objects allow us to group values - including other objects - to build more complex (data) structures.

*9. How do you define an object? *
You create a list of properties separated by commas.
Each property has a name followed by a colon and a value.
To define the object, you enclose the above in curly braces.

10. what can you say about the mutability of JavaScript objects?
You can change the properties of JavaScript objects, causing a single object value to have different content at different times. This is in contrast to numbers, strings and Booleans that are immutable.

Second Part:

1. Why can’t you add new properties to a string variable?
If you try to add a new property, it does not stick. The string does not store the new property.

2. What are rest parameters?
A rest parameter is a parameter that is written last in the code line preceded by three dots(…). It refers to the “rest of” (remaining) arguments. This allows the function to have any number of arguments.

3. What is serialization and what is a use case of serialization of data?
Serialization is the conversion of data into a flat description. JavaScript properties grasp values rather than contain them. Information such as objects and arrays, are stored in the computer’s memory by their addresses (not their actual values). If you want to save the data file or send it to another computer, you would be sending a jumble of addresses (tangles of memory addresses). A solution is to serialize the data.

4. What is JSON?
JavaScript Object Notation, which is a type of serialization format.

5. What are the differences between JSON and the way programmers write objects in plain JavaScript?
JSON has a few restrictions:

  1. All property names have to be surrounded by double quotes.
  2. Only simple data expressions are allowed; no function calls, bindings, or anything that involves computation.
  3. Comments are not allowed in JSON.
1 Like

PART ONE

  1. This problem needs a way to store complex data structures.
  2. An array is used to store a sequence of data.
  3. Properties are qualities of a value, such as the length of a string or the index of a value.
  4. Null and Undefined do not have properties.
  5. You can access the properties with either a dot (value.x) or with square brackets (value[x]).
  6. Methods are functions that live in properties and (usually) act on the value they are a property of.
  7. Objects are arbitrary collections of properties.
  8. Objects allows us to save multiple types of data in one data set such as booleans, integers, and strings.
  9. name : value. If you have multiple objects, you can separate them by commas and if going over multiple lines {} are used.
  10. Data can be added and removed, and even renamed which allows flexibility in writing code. It isn't necessary to go back to the original block and change it, you can add or remove objects as necessary.

PART TWO

  1. A string is not an object, and is therefore immutable, and cannot be changed.
  2. Rest Parameters is bound to an array containing all further arguments. If there are other parameters before it, their values aren’t part of that array.
  3. Will do.
  4. Serialization is data converted into a flat description. This is helpful when you want to send or store data to retrieve it later.
  5. JASON is a popular serialization format widely 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?
Strings and integers alone do not provide the data structure needed for Jacques record all of his daily events data and their correlation to lycanthropy. He needs to set up an array of events with varying types of data that correlate to lycanthropy or not.

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 define a value of in some way which could be a multitude of things including the length of a ‘string’. properties are called with a dot or [ ].

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

5. How can we access properties in a value (two ways)?
Dot and Square Bracket.

6. What are methods?
Properties that contain a value derived from a function.

7. What are objects?
A value comprised of a collection of properties form a specific type of data structure called Object.

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 be connected to an unlimited number of properties to comprise unique values and these connections can be altered or changed impacting the value of the object.

9. How do you define an object?
Curley braces { } define objects when such braces are not located at the start of a statement.

10. What can you say about the mutability of Javascript objects?
Object values can be changed by altering one or more property values, hence different object values cannot be compared, but object identity can be compared.

SECOND PART:

1. Why can’t you add new properties to a string variable?
Values of type string, number, and Boolean are not objects… if you try to set new properties on them, it
doesn’t actually store those properties… such values are immutable and cannot be changed… they do however have built-in properties.

2. What are rest parameter?s
A function that accepts any number of arguments… example, Math.max computes the maximum of all the arguments it is given.

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

4. What is serialisation and what is a use case of serialisation of data?
Serialization is the conversion of stored objects, arrays etc… into flat data formats used to store or send the data as a flat information file and without the Javascript functionality.

5. What is JSON?
JSON (pronounced “Jason”), 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.

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 in JSON, 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?
    Strings and integers only hold single type data. We need a data structure that is capable of multiple values.

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

  3. What are properties in Javascript?
    They define characteristics about the values in a data structure. They’re expressions that access a property of almost all JS value.

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

  5. How can we access properties in a value (two ways)?
    With a dot . or square brackets []
    The word after the dot is the literal name of the property while brackets contain evaluate the expression to get the property name.

  6. What are methods?
    It’s a function for a type of value. They only work for values that they belong to.

  7. What are objects?
    They are collections of properties that the user can store different types of values.

  8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
    Objects can store values of different types of integers, booleans, strings and arrays.

  9. How do you define an object?
    Like any variable except it’s enclosed with curly braces.

  10. What can you say about the mutability of Javascript objects?
    It means that objects 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?
    Strings are immutable.

  2. What are rest parameters?
    They are useful for functions that accept any number of arguments. When a function is called, the rest parameter is bound to an array containing all further 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?.
    It’s when data is converted into a flat description to be sent over digitally. This is because objects and arrays are stored as bits holding addresses. They have to be put into a data management notation.

  5. What is JSON?
    It’s a popular serialization format, JavaScript Object Notation. 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?
    Simple expressions are allowed in JSON. No functions, bindings, comments or computations.

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?

Variable types like strings and integers can only store one type of data. In order to be able to track both activities during the day and wheter he turns to a squirrel the given day, you need someting more than variable types like stings or integers.

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

You can use objects or arrays.

3. What are properties in Javascript?

Properties are values associated with a JavaScript object. They can usually be changed, added or deleted.

4. Which values do not have properties?

Null and undefined.

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

There are two main ways of accessing properties in JavaScript: with a dot and with square brackets. Value.x and Value[x] access a property of Value, but not necessarily the same property.

6. What are methods?

A method is a property that contains a function that targets the value that it’s attached to.

7. What are objects?

Objects are a collection of a variable amount of different data types, called 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 dynamic in the way that they can hold any number of different properties, in terms of type or quantity.

9. How do you define an object?

Objects are defined as a variable with let, var och const followed by the given name of the object. The = operator is then used before the {}. It’s within these curly brackets that all the properties is listed. Each
property has a name followed by a colon and a value. The different properties are separated with commas.

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

Objects are mutable since you can change their properties so that they will have different values at different times.

SECOND PART:

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

Strings aren’t objects. So while the language doesn’t complain if you try to set new properties on a string; the property wont be stored. The same goes for numbers and booleans. All such values are immutable in this way, even though they have a few built in properties.

2. What are rest parameters?

Rest parameters is a way to let a function accept any number of arguments. The syntax is three dots before the last parameter.

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

4. What is serialization and what is a use case of serialization of data?

Serialization is a way to convert data into a flat description, independent of the memory addresses of the source computer. This is useful when you want to send data to another computer without access to your computer memory. An alternative to serialization would be to send your entire computer memory, but that’d be way too inconvenient.

5. What is JSON?

JSON stands for JavaScript Object Notation and it’s a popular serialization format; even outside of JavaScript. It’s used widely on the Web as a data storage and communication format.

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

The two are similar with a few differences. All property names have to be surrounded by double quotes and no function calls, bindings or actual computations are allowed.

1 Like
  1. Data set structures
  2. Array
  3. Expressions that access properties of some value
  4. Null and undefined
  5. Either with a dot . or with square brackets
  6. Properties that contain functions
  7. Arbitrary collection of properties
  8. You can define new properties of an object
  9. With Braces, inside the braces are a set of properties defined by colons and separated by commas
  10. Not only are their properties changeable, they can as well be set to give different content at different times

Second part:

  1. Because they are immutable
  2. est parameter is bound to an array containing all further arguments
  3. Skipped with pleasure
  4. Data converted into a flat description.
  5. JSON is a popular serialization format and stands for JavaScript Object Notification and is used a lot for web and even other languages than Javascript
  6. Objects have to be surrounded by double quotation marks, nothing that requires computation is allowed and no comments possible.
1 Like
  1. The weresquirrel must track multiple different data events and data types. Ex, what events occurred that day and if he transformed (boolean).

  2. An object can be used to store all those values.

  3. Properties in javascript are values stored within and describing objects.

  4. Null and undefined do not have properties.

  5. Properties can be accessed by () or [] depending on their value type.

  6. Methods are a special collection of functions that live within properties and generally act on a value they are a property of.

  7. Objects are arbitrary collections of properties set at a single value.

  8. Objects allow developers to store multiple different data types under a single value.

  9. Objects are defined by declaring the variable with all the properties contained within curly braces. The properties are then written as key : value pairs.

  10. Objects in javascript are mutable, meaning that they can be changed by the user, compared to variables, which cannot be changed.

Part 2.

  1. String values cannot be changed.

  2. Rest parameters are arguments containing the operator (…) which binds all further arguments to an array, which is useful in writing a function that can accept any number of arguments.

  3. Serialisation is the process of converting your code data into a format that can be read when saved or sent to a different computer. This is important because properties store this data in local memory, so the code must be notated as a flat description.

  4. JSON is short for JavaScript Object Notation, which is one of the most widely used formats for serialization.

  5. JSON and Javascript are almost identical, but JSON cannot call functions or set bindings, or do anything involving computation. Properties in JSON must also be surrounded in double quotes (" ").

1 Like
1. Storing sequences of values
2. Array
3. Expressions that access properties of values.
4. null and undefined
5. value.x and value[x]
6. Properties that contain functions are called methods of the value they belong to.
7. Values of the type object are arbitrary collections of properties. 
8. A way to handle more complex sets of data.
9. let day1 = { squirrel: false, events: ["work", "touched tree", "pizza", "running"] };
10. You can change object properties, causing a single object value to have different content at different times.

SECOND PART:
1. It will return undefined.
2. When a function that accepts any number of arguments is called, the rest parameter is bound to an array containing all further arguments.
3. You can have a function max() defined that will be different from Math.max()
4. Serialisation of data means to convert it into a flat description.What is serialisation and what is a use case of serialisation of data?
5. JASON is a popular serialization format
6. 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. Jacques needs a data structure which can store multiple values in order to keep everything in order.
    2.We can use arrays which is written as a list of values between square brackets ,separated by commas.
  2. Properties are characteristics of objects ,often describing attributes associated with a data structure.
  3. null and undefined.
  4. We can access properties with a dot or square brackets.
    value.x and value[x]
  5. Methods are properties that contain functions such as ".toUpperCase() " which will return a copy of a string in which all letters have been converted to uppercase.
  6. javascript objects are containers for named values called properties or methods.
  7. Objects allow us to hold as many different datatypes as we need.
  8. let anObject = {
    propertyOne: 1,
    propertyTwo: 2
    };
    10.Object values can be modified while types of values such as numbers, strings, and booleans are all immutable.
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?
    Ans: The problem at hand requires us to store and group multiple values (of different data types) into one value/variable. This cannot be achieved by variable types such as strings or integers.

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

  3. What are properties in Javascript?
    Ans: Properties in Javascript are ‘‘attributes’’ or ‘‘features’’ (for the lack of better words to describe a property) of a values.

  4. Which values do not have properties?
    Ans: The values ‘null’ and ‘undefined’ do not have any properties associated with them.

  5. How can we access properties in a value (two ways)?
    Ans: The two ways in which we can access the properties in a value is by typing out the following: value.x and value[x], where x is the name of the property to be accessed.

  6. What are methods?
    Ans: “Properties that contain functions are generally called methods of the value they belong to.” source: textbook

  7. What are objects?
    Ans: Objects are complex structures of data that are created by grouping various values and sometimes even by grouping values and objects themselves. Alternately, 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)?
    Ans: Value types such as integer, string, array, Boolean, etc. cannot store multiple values or data types into them. This is the problem that objects can solve.

  9. How do you define an object?
    Ans: You define an object as follows:

let AppleList = {
vegetable: false,
attributes: [“red”, “roundish”, “1 dollar/apple”]
};

  1. What can you say about the mutability of Javascript objects?
    Ans: Objects are mutable in the sense that you can change their properties.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    Ans: By default (or by their very nature), string variables are immutable. Hence, you cannot add new properties to them.

  2. What are rest parameters?
    Ans: Per my google search (because I couldn’t find the answer in the textbook), the “rest parameter syntax allows us to represent an indefinite number of arguments as an array”

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

  4. What is serialisation and what is a use case of serialisation of data?
    Ans: Serialisation is to convert the value into a flat description. A use case of serialisation of data is as a JSON file, where you can serialise data for storage or communication purposes.

  5. What is JSON?
    Ans: JSON stands for Javascript Object Notation. It is a file in which the data has been serialised.

  6. What are the differences between JSON and the way programmers write objects in plain
    Javascript?
    Ans: In JSON, objects’ properties must be surrounded by double quotes and “only simple data expressions are allowed,” which means function calls, bindings, etc. are not allowed.

1 Like
  1. Limited amount of data, not possible to combined.
  2. An array can store multiple values, it is better to sequence things.
  3. Properties in Javascript are expressions that access a property of some value.
  4. Almost all javascript values has properties, the exceptions are null and undefined.
  5. With a dot and with square bracket. Both value.x and value[x] a
  6. Properties that contains functions are called methods. To push method adds value to the end of an array.
  7. Objects are arbitrary collections of properties, values of the type object.
  8. Objects can look at different values, and provide a unique combined solution
  9. You can use braces to define an object. Inside the braces, you can list properties separated by commas.
  10. Values such as numbers, strings, and Booleans, are all immutable, it is impossible to change values of those types. Objects works differently, you can change their properties.
    Second Part
  11. String are not objects, strings are immutable. You can not add new properties to a string.
  12. Rest parameters are place before a function last parameter. Represented by three dots. When a function is called is bound to an array containing all further arguments.
  13. Serialization means data is converted into a flat description, one serialization format could be JSON.
  14. JSON stands for Javascript object, it is a format used for storing and exchanging data on the web.
  15. In JSON no comments are allow, property names must be double quote, and only simple data expressions are allowed, (no function calls or binding)
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?
  • Objects. They are able to store multiple data types and variables that hold those data types in one object.
  1. What variable type can be used in order to solve the problem of storing multiple values?
  • Arrays.
  1. What are properties in Javascript?
  • These define some characteristic about the values in a data structure, such as the length of an array or the index of a value.
  1. Which values do not have properties?
  • Null and Undefined.
  1. How can we access properties in a value (two ways)?
  • The can be accessed through square brackets or by using a dot and the name of the variable that holds the value.
  1. What are methods?
  • Methods are properties that hold function values.
  1. What are objects?
  • They are data structures that are capable of containing an arbitrary 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)?
  • They are able to store multiple data types and variables that hold those data types in one object.
  1. How do you define an object?
  • They are defined like any other variable with its values being stored like arrays, with angle brackets and separated by a commas
  1. 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. Like changing the name cat to rat.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
  • They are immutable.
  1. What are rest parameters?
  • Rest parameters are bound to an array containing all additional arguments given to a function. They allows us to represent any number of arguments as an array.
  1. What is serialisation and what is a use case of serialisation of data?
  • Serialization is the fact of storing your data structures to a transfer compatible format.
  1. What is JSON?
  • JavaScript Object Notation is a serialisation format widely used for data storage and communication.
  1. What are the differences between JSON and the way programmers write objects in plain Javascript?
  • Only simple expressions are allowed in JSON. There are no functions, bindings, comments, or computations. All property names have to be surrounded by double quotes.
1 Like

1.Multiple data types with different variables is what is introduced in this chapter that strings or integers cannot solve

  1. An array will store multiple sequences of values

3.Properties in JavaScript are values like names for strings

  1. null an undefined

  2. value.x and value[x]

  3. Methods are properties that contain functions with values like an array and a push method that adds value to the end

7.Objects are arbitrary collections of data theses are located in braces and used as an expression

  1. Objects give you the flexibility to group more than one data type into a single value

  2. Objects are a list of values inside braces that are connected to that list like an octopus and its tentacles

  3. JavaScript objects in reference to mutability can change values as booleans and strings can’t

Second Part

1 They are immutable and cannot be changed because they are not objects

  1. They are three dots before the functions last parameters these are used to call an array bound to the function containing all further arguments

  2. Serialisation of data is converting it into a flat description which is used to store data and communication on the web

  3. JavaScript Object Notation

5.All property names need to be surrounded in double quotes and only simple data expressions are allowed. So no function calls, bindings, or anything that involves actual computation. Also, comments are not allowed in JSON

1 Like

1.) The problem that is introduced is the need for a data structure that can hold multiple values within the same variable.
2.) An array can store multiple values.
3.) Properties are elements or values within an array.
4.) Null and undefined have no properties.
5.) The two ways to access properties in a value are value.x for the specific property named x and value[x] to call on a property to be evaluated and returned.
6.) Methods are properties that contain values.
7.) Objects are arbitrary collections of properties.
8.) Objects can store different types of values within the same variable, and can also be modified because unlike strings, Boolean, arrays, and integers, objects aren’t immutable.
9.) An object is defined within curly braces. {}
10.) Objects aren’t immutable which makes them modifiable.
Part Two:
1.)A string is immutable, so it can’t be changed.
2.) Rest parameters allow you to add as many arguments on to a function as desired by binding … to the last parameter in an array.
3.) Skiporino, Paul Sorvinno.
4.) Serialization is the conversion of data into a flat description.
5.) Javascript Object Notation (JSON) is a data storage and communication format online, and can move across several different languages.
6.) JSON is different from JavaScript because all property names have to be surrounded by parentheses, and only simple data expressions are permitted.

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 sequences of values with properties

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

  3. What are properties in Javascript?
    Properties of a value that detail an element of that value

  4. Which values do not have properties?
    null
    undefined

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

  6. What are methods?
    properties that hold function values

  7. What are objects?
    Values of the 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)?
    store arbitrary collections of properties

  9. How do you define an object?
    One way to create an object is by using braces as an expression.
    let object = { all object stuff }

  10. What can you say about the mutability of Javascript objects?
    Objects have mutable properties.
    Number, strings, booleans on other hand have immutable properties

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    It would change string in another type of ‘object’ if that makes sense

  2. What are rest parameters?
    A way to collect all remaining elements into an array with the three DOT notation

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

  4. What is serialisation and what is a use case of serialisation of data?
    putting all data after one another
    to for instance easily communicate it in a string format

  5. What is JSON?
    JavaScript Object Notation
    a flat textual notation between {}

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

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 be able to extract individual values from a sequence of values. We also need to store different properties with these values.

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

An array

3. What are properties in Javascript?

A property is a characteristic of a value or object

4. Which values do not have properties?

null and undefined do not have properties

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

Properties can be accessed with a dot or with square brackets e.g. value.x or value[x].
value.x will return the property “value” of x whereas value[x] will evaluate the expression x and will use the result as the property name.

6. What are methods?

Methods are properties that contain functions

7. What are objects?

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

you can store multiple value types in one object, each of which can be extracted when needed

9. How do you define an object?

surrounding the object’s properties with braces

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

Properties of objects can be changed by code at any time.

SECOND PART:

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

They are immutable, no code can change any value of the string.

2. What are rest parameters?

a rest parameter is an array that contains any number of arguments that can be passed to a function

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

Too late… :stuck_out_tongue:

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

serialisation is the conversion of data into a flat description. This is usually used for data storage or communication over the internet

5. What is JSON?

JSON is a serialisation format (full name: JavaScript Object Notation). Data can be converted to this format using JSON.stringify and it can be changed back using JSON.parse

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

All property names need to be surrounded by double quotes, comments are not allowed, and only simple data expressions are allowed (no function calls, bindings or anything involving computation).

1 Like