Data Structures (Arrays and Objects) - Reading Assignment

1.- You cannot add new properties to a string value because they are not objects thus are immutable.
2.- They accept any number of arguments “…”
3.- Done :slight_smile:
4.- It is by which data is turn into a flat description - example: Saving data to a database serialzing an object (Hope thats clear).
5.- It is by how serialization happens - It is a way to display data in a system or to generalize it.
6.- The way the it is written is different you do not have any function calls or binding, only simple data expressions are allowed

1 Like

A)

  1. store multiple values
  2. Arrays & Objects
  3. charateristics of values
  4. Null and undefined
  5. (dot) .length e.g. / array[“length”]
  6. methods are properties that hold function values. e.g. .toUpperCase
  7. collection of properties, inside different values
  8. store as many datatypes as there are needed
  9. Braces are used to create objects. Inside the braces are separated by commas. Each property is named, followed by a colon and a value.
  10. objects can be moddified. Properties changed, causing values to be different.
    B)
  11. strings are immutable
  12. Rest parameters allows us to represent any number of arguments as an array
  13. Serialisation is the conversion of data into a flat description, which is useful for saving and sending data.
  14. JavaScript Object Notation / popular serialisation format used for data storeage and comc. in web
  15. JSON: property names-> sourrounded by double quotes-> no comments 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?

Jacques need to store a list of events, activities and booleans into a single log of entries. A string cannot perform it, but an array could.

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

  2. What are properties in Javascript?
    Expressions to access a specific characteristic of a element of a string.

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

  4. How can we access properties in a value (two ways)?
    writing “value.” + name of the property. The name can be put after a dot “.” or wrapped in brackets “[]”. In the first way you call the value by its name, and in the second you evaluate the expression and convert its result to a string.

  5. What are methods?
    Properties that hold function values.

  6. What are objects?
    Arbitrary collection of properties.

  7. 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 allow other code to change the value inside of an object.

  8. How do you define an object?

Its is a way to store different types of data inside a single structure so you can interact with all the types of data at the same time.

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

Even though you can’t change values like strings, numbers and booleans, you still can derive new values from them. When we talk about objects we can change the properties so the same object will have different content at different times.

  1. Why can’t you add new properties to a string variable?
    Because the values inside a string are not changeable.

  2. What are rest parameters?
    A form of parameter that creates a array with a set of arguments defined within a function.

  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?
    Its a conversion of data into a flat description. Its used to save of send information stored within a computer.

  5. What is JSON?
    JavaScript Object Notation is a format of serialisation.

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

1 Like
  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?

Jacques need to store multiple values within a variable

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

Arrays

  1. What are properties in Javascript?

Properties are expressions that access a property of some value.

  1. Which values do not have properties?

Null and Undefined

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

A: value.X. The word after the dot is the literal name of the property
B: value[X]. Fetches the property of the value named “X” and tries to evaluate the expression and uses the result as the property name

  1. What are methods?

Methods are properties that contain functions

  1. What are objects?

Objects are arbitrary collections 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 allow a list of values of different datatypes to be stored

  1. How do you define an object?

Objects are defined within the curly braces “{}”. The properties of the object are separated by commas. Property names and their values are separated by colons.

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

Object properties can be changed, causing a single object value to have different content at different times. It is impossible to change the value of normal bindings.

Part 2

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

Strings are immutable, hence their properties are built in and accessing them will always return the same result on all strings of that same value. Stings can be combined to create new values but specific strings can never be changed.

  1. What are rest parameters?

A rest parameter is a function which allows the spread operator can copy elements of an array into another while the rest operator allows a function to take in the rest or any number of parameters into operation

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

Serialization of data is conversion of data into a flat description, useful for saving and sending.

  1. What is JSON?

JSON stands for Javascript Object Notation. (JSON) It is widely used as a
data storage and communication format on the Web, even in languages other
than JavaScript.

  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 expressions are allowed. Comments are not allowed in
JSON.

1 Like

1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
He needs to save several values that cannot be saved in one variable.
2. What variable type can be used in order to solve the problem of storing multiple values?
Arrays are capable of storing multiple values.
3. What are properties in Javascript?
Properties are characteristics of a value, often describing attributes.
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 with
square brackets.
6. What are methods?
Properties that contain functions are generally called methods of the value
they belong to.
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)?
When we need to store a series of values.
9. How do you define an object?
Objects are a type of data structure that allow us to group values, including other objects to create complex structures.
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?
Such values are immutable and cannot be changed.
2. What are rest parameters?
Rest parameters are used to create functions that 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 of data means that it is converted to a flat description, is useful when we want to do things like saving the data to a file or transferring it to another computer on a network.
5. What is JSON?
JavaScript Object Notation is a serialisation format widely used for data storage and communication.
6. What are the differences between JSON and the way programmers write objects in plain Javascript?
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. 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?
    His data set will be “awkwardly” stored as a string or integer variable, he needs a list of his data…aka an array

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

  3. What are properties in Javascript?
    Features of a piece of data, such as length or numerical value

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

  5. How can we access properties in a value (two ways)?
    Using a dot or square brackets (value.x where is x is the literal property name, or value[x] where JS will conjure up the property name for x)

  6. What are methods?
    Properties that contain functions

  7. What are objects?
    A collection of data of various types, and its properties, into a single 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)?

  9. How do you define an object?
    with braces { } listing properties separated by commas , followed by colon and its value, like so
    anObject = { left : 1, right : 2 }

  10. What can you say about the mutability of Javascript objects?
    The ability to change the objects properties

SECOND

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

  2. What are rest parameters?
    A function to accept any number of arguments, indicated by three dots before the fn last parameter

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

  4. What is serialisation and what is a use case of serialisation of data?
    Conversion of data to a flat description

  5. What is JSON?
    JavaScript Object Notation - serialization format

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    Property names in JSON need double quotes, no function calls/bindings/computation…you can use JSON.stringify and JSON.parse to convert data to and from this format

1 Like
  1. The relation between sets of related items.
    2.arrays
  2. properties describe the elements or items in the array
  3. null and undefined
  4. value.x or value[x]
    6 methods are properties that contain functions that are “methods” related to the values that they belong to
    7objects are arbitrary collections of properties
  5. objects solve relational or binding connections of random data groups.
  6. an object is defined as it is enclosed by braces, assigned to a variable, and the properties are listed followed by colons and their values are enclosed by brackets and separated by commasl
  7. mutability in Javascript expresses relationships of independence

(second part)
1.because a string is not an object
2rest parameter only looks at the existing state of the array
3. thank you I skipped.
4. to serialize data is to convert into flat description sets
5. json is used for data storage and communication on the web between languages
6. json does not use functions or descriptions. property names get double quotes.

1 Like

What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
He needs to store multiple values within a variable.

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

What are properties in Javascript?
Expressions that access a property of some value.

Which values do not have properties?
Null and undefined.

How can we access properties in a value (two ways)?
Dot or bracket notation.

What are methods?
Properties that contain function values.

What are objects?
Objects are random collections 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)?
Objects can store different types of values.

How do you define an object?
You have to use braces as an expression. Inside the braces, each property is separated by commas. Each property has a name followed by a colon and a value. Properties whose names aren’t valid binding names or valid numbers have to be quoted.

What can you say about the mutability of Javascript objects?
You can change the properties in an object causing a single object value to have different content at different times.

Why can’t you add new properties to a string variable?
String values are immutable.

What are rest parameters?
Rest parameters allow a function to accept any number of arguments. To implement this you have to write three dots before the function’s last parameter.

What is serialisation and what is a use case of serialisation of data?
Serialization is the conversion of data into a flat description and is used to send data to other computers.

What is JSON?
JavaScript Object Notation or JSON is widely used as a data storage and communication format on the Web.

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 expressions are allowed which means no function calls, or bindings. Comments are also not allowed in JSON.

1 Like
  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
    It solves the problem of storing sequences of or multiple values.

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

  3. What are properties in Javascript?
    Properties are characteristics of 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)?
    Properties in a value are accessed with a dot (.) and with square brackets ([ ]).

  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 more complex and they may contain any combination of other data types including numbers, strings, booleans, variables and arrays.

  9. How do you define an object?
    Objects are defined using braces ({ }) known as the object literal syntax. Objects are also defined using the constructors, object constructors and the prototype pattern.

  10. What can you say about the mutability of Javascript objects?
    Unlike values such as numbers, strings, and booleans that are immutable, you cannot change the properties of objects.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    This is because strings are primitive values and so are immutable.

  2. What are rest parameters?
    Rest parameters are 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. What is serialisation and what is a use case of serialisation of data?
    Serialisation is 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 (Javascript Object Notation) is an open standard format which is lightweight and text-based, designed explicitly for human readable data interchange. It is a language-independent data format. It supports almost every kind of language, framework, and library.

  5. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON is a language-independent data; it supports almost every kind of language. Javascript objects are only used in Javascript. JSON translate data into human readable format; Javascript objects do not need to be translated to be understood.

1 Like
  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?

The variable types of strings and integers cannot store multiple values or more complex information.

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

Arrays.

  1. What are properties in Javascript?

Values associated with an object or variable in javascript.

  1. Which values do not have properties?

undefined and null

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

a dot or [ ] after the name of the variable or object of interest

  1. What are methods?

methods are properties that contain a function which manipulates the variable or object of interest in some way

  1. What are objects?

a collection of unordered 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 allow us to assign multiple properties to a single variable because they are not constrained by the type of data they can contain

  1. How do you define an object?

objects are defined by { } braces

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

unlike strings, values, and booleans, the data and values inside objects can be changed

1 Like

P1

  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 the fact that may real world problems require complex ways of storing and using data and you quickly realize the limited ability of variables, strings and even arrays.
  1. What variable type can be used in order to solve the problem of storing multiple values?
  • Object variables
  1. What are properties in Javascript?
  • They are the values of the object - objectName.property
  1. Which values do not have properties?
  • Methods
  1. How can we access properties in a value (two ways)?
  • objectName.propery OR objectName[‘properyName’]
  1. What are methods?
  • They are an objects functions, which when invoked will typically perform an action
  1. What are objects?
  • A basic data structure that aims to describe complex, real-world things or ideas
  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 solve real-world problems that call for complexity beyond a single value or type of data.
  1. How do you define an object?
  • {} or const objectName = {};
  1. What can you say about the mutability of Javascript objects?
  • They are able to be modified and changed throughout an object’s life and can also be modified through references to it by other variables pointing to its memory address.

P2

  1. Why can’t you add new properties to a string variable?
  • Strings are immutable
  1. What are rest parameters?
  • A way that a function can take 1 or more arguments, which are then turned into an array of items
  1. (Feel free to skip the sub-chapter of Math object and Destructing)
  2. What is serialisation and what is a use case of serialisation of data?
  3. What is JSON?
  • Javascript Object Notation. Stringifies objects which is used send and receive data over the web
  1. What are the differences between JSON and the way programmers write objects in plain Javascript?
  • The property names in JSON are enclosed in double quotes and cannot contain function calls , comments, or code that results in a computation
1 Like
  1. It introduces a problem when different types of data are required “together”.
  2. Arrays and objects
  3. Characteristics of values in a data structure
  4. Null & Undefined
  5. value.x and value[x]
  6. Properties which contain functions
  7. Groupings of data
  8. They allow data to be mutable
  9. As any other variable, with the value being a list contained within braces.
  10. That the data included in objects can be changed. Something not possible with other types of data commented so far

Part 2

  1. Becasue strings are immutable = don´t permit modifications
  2. A parameter used in functions with any number of arguments. It is represented by 3 dots “…”
  3. Serialisation is converting data stored in memory into a flat description of what that data is.
  4. JavaScript Object Notation is a serialisation format widely used for data storage and communication.
  5. Only simple expressions are allowed in JSON. There are no functions, bindings, comments, or computations
1 Like
  1. The problems that when using variable types such as strings/integers alone, the values cannot grouped to build more complex data structures.
  2. Objects and arrays allow the grouping of multiple values into a single value.
  3. Properties refer to the values within JavaScript objects.
  4. “null” and “undefined” are nonvalues, thus no properties.
  5. The two ways are by using value.x and value{x].
  6. Methods refer to properties that contain functions for the values.
  7. An object is an arbitrary collections of properties. One way to create an object is by using braces as an expression.
  8. It solves the problem of immutable aspect of values, because object properties can change thus the content of object values can be different.
  9. An object is an arbitrary collections of properties. One way to create an object is by using braces as an expression.
  10. JavaScript objects are mutable. Their properties can change.

Second Part

  1. Because a string variable does not store new properties that we set.
  2. Rest parameters are parameters with three dots before the functions’ last parameter. This allows a function to accept any number of arguments.
  3. Noted.
    4.Serialisation is converting the data in a file into a flat description. It is useful when we want to save data for later use or for sending to another computer over the network.
  4. JSON stands for JavaScript Object Notation. It is a popular serialization format. It is widely used as a data storage and communication format on the Web.
  5. JSON has a few restrictions that does not exist in plain JavaScript: 1) need double quotes for all property names, 2) simple data expressions only, 3) no comments allowed.
1 Like

Questions
. Strings and integers cannot solve problems which involve storing multiple values of data which can determine the conditions which are needed to fulfill a condition.
. Arrays can store multiple values.
. Properties are characteristics which define data.
. Undefined and null do not have properties.
. Properties may be accessed with a dot, value.x, and square brackets, value[x].
. Methods are properties which contain values.
. Objects are made up of an arbitrary collection of properties.
. They are capable of storing any type of data value, not just an integer or a string.
. They are designed with braces containing a list of properties.
. It is possible to replace existing values.
. The string variable is immutable.
. Rest parameters are functions bound to an array and contains all arguments while being made up of three dots.
. Serialization converts data into a basic description and examples include communication and storing of data.
. Javascript object notation is used for communication and data storage on the web.
. Property names must be surrounded by double quotes, only simple data expressions are allowed and no comments are allowed.

1 Like

First part:

  1. Storing history/log data.
  2. Arrays
  3. A JavaScript property is a characteristic of the value/object, often describing attributes associated with a data structure. There are two kinds of properties: 1) Instance properties - hold data that are specific to a given object instance; 2) Static properties hold data that are shared among all object instances.
  4. Null and undefined
  5. value.x or value[x], but x is not necessarily the same property
  6. Properties that contain functions are generally called methods of the value they belong to.
  7. JavaScript object is a standalone entity that holds multiple values in terms of properties and methods. Object property stores a literal value and method represents function.
  8. Object can hold different datatypes in itself
  9. let objectName = {
    property1: 123,
    property2: “propertyTwo”,
    property3: [1, 2, 3, 4, 5],
    property4: true}
  10. Unlike numbers, strings and Booleans, which are immutable values, objects can be modified. Objects can have their properties changed, causing a single value to have different value at a certain moment in time.

Second part:

  1. Values of type string, number, and Boolean are not objects, and though the language doesn’t complain if you try to set new properties on them, it doesn’t actually store those properties. Such values are immutable and cannot be changed.
  2. The rest parameter syntax allows a function to accept an indefinite number of arguments as an array.
  3. Serialisation is the process of translating a data structure or object state into a format that can be stored. A popular serialisation format is JSON.
  4. JSON stands for JavaScript Object Notation and is used as a data storage and communication format on the Web.
  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. 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?.
  • this chapter introduces a data structure that stores multiple values.
  1. What variable type can be used in order to solve the problem of storing multiple values?

Arrays can be used for storing multiple values
3. What are properties in Javascript?
properties these are value expressions in Javascript

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

  2. How can we access properties in a value (two ways)?
    with a dot and with square brackets. e.g value.x, value[x]

  3. What are methods?
    are properties containing functions and they contain only value that they belong to.

  4. What are objects
    are arbitrary collection of properties

  5. 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 stores a list or multiple data activities with value that we need.

  6. How do you define an object?
    braces with a list of properties separated by commas, each property containing a name followed by a colon and value.

  7. What can you say about the mutability of Javascript objects?
    it is impossible to change the type of value, you can combine and drive new value from them but when you take a specific string value, that value will always remain the same.

SECOND PART:

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

  2. What are rest parameters?
    bound to an array containing all further arguments
    3…

  3. What is serialisation and what is a use case of serialisation of data?
    serialisation is when data is being converted in to a flat description. it is used when you want to save data in a file for later or send it to another computer over the network.

  4. What is JSON?
    a popular serialisation format. is data storage and communication format on the Web. it stands for JavaScript Object Notation, also known as Jason.

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

1 Like

FIRST PART:

  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
    Strings and integers do not allow a program to represent large quantities of information with a convenient structure. Working with multiple variables and data types requires an approriate data structure.

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

  3. What are properties in Javascript?
    These are expressions that access a property of some value 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 of the value they belog to that contain functions

  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.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    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. What are rest parameters?
    Rest parameter is an improved way to handle function parameter , allowing us to more easily handle various input as parameters in a function. With the help of a rest parameter a function can be called with any number of arguments, no matter how it was defined.

  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?
    Is the process of translating a data structure state into a format that can be stored (for example, in a file or memory data buffer or transmitted (for example, over a computer network and reconstructed later (possibly in a different computer environment).

  5. What is JSON?
    SON 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?
    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. We need to be able to have multiple events for a single day, which you can’t do with a single variable string or integer.
  2. Arrays can be used to solve the problem of storing multiple variables.
  3. Properties are expressions that access a property of some value, like accessing the length property of the value in myString.length, or accessing the max property in the Math object by using Math.max.
  4. The values null and undefined don’t have any properties.
  5. Two ways to access properties in Javascript are with a dot and with square brackets, for example both value.x and value[x] access a property on value, but the difference is how x is interpreted, with the dot the word after the dot is the literal name of the property, with the square brackets the expression between the brackets is evaluated to get the property name.
  6. Properties that contain functions are called methods of the value they belong to, for example toUpperCase is a method of a string, and push is a method that adds value to the end of an array.
  7. Objects are arbitrary collections of properties.
  8. Objects can store values of any type and multiple types at once.
  9. Objects are defined like a variable with the properties inbetween braces, like this
let object1 = {
    value1: x, value2: "y", value3: true
}
  1. Other types of values like numbers, strings, and Booleans, are all immutable, so it is impossible to change values of those types, you can combine them and derive new values from them, but when you take a specific string value it will always remain the same, as where you can change the properties of objects causing a single object value to have different content at different times.
    Second Part:
  2. You can’t add new properties to a string variable because they are immutable.
  3. Rest parameters using three dots let you have a function accept any number of arguments by having the rest parameter bound to an array containing all further arguments.
  4. Serialization is converting into a flat description, which is used to save data in a file for later or sending it to another computer over the network.
  5. JSON is a popular serialization format that is widely used as a data storage and communications format on the Web.
  6. JSON looks similar to Javascript but all property names have to be in double quotes, and only simple data expressions are allowed, no function calls, bindings, or anything that involves actual computation, and comments are not allowed.
1 Like

Part 1 of 2:

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 a single type of data. The Weresquirrel guy needs something that can hold multiple values to help him eliminate the things that are not causing him to change.

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 JavaScript property is a characteristic 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)?

We can access properties using a dot and with square brackets.

6. What are methods?

Methods are properties that contain functions.

7. What are objects?

An object is a collection of properties, and a property is an association between a name and a value.

8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?

Integers, strings, arrays, and booleans are all immutable. However, the properties of objects can be changed.

9. How do you define an object?

An object is a collection of properties.

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

Unlike other value types, the mutability of objects in Javascript gives the programmer the ability to combine them and derive new values.

Part 2 of 2:

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

Because strings are immutable.

2. What are rest parameters?

Rest parameters are functions designed to accept any number of arguments. To write one the programmer puts three dots before the function’s 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 when data is converted into a flat description. It’s oftentimes used if you want to save data in a file for later or send it to another computer over the network.

5. What is JSON?

JSON is short for: JavaScript Object Notation 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?

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. Another difference: Comments are not allowed.

1 Like

1.What are problems this chapter introduce that cannot be solved with variable types such as strings or intergers?** Storing multiple values and value types in a single variable.

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

3.What are properties in Javascript? Values inside of an object.

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

5.How can we access properties in a value? The dot notation and the bracket notation.

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

7. What are objects? A data set that contains a arbitrary collection 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 store various values into one variable.

9. How do you define an object? let objectA = {event1: “work”, event2: “play”};

10.What can you say about the mutability of Javascript objects? Object properties are mutable.

Part 2

1.Why can’t you add new properties to a string variable? String variables are not objects therefore they are immutable.

2.What are rest parameters? A function that denotes the last parameter with 3 dots before its name and are useful for functions that accept any number of arguments.

3.What is serialization and what is a use case of serialization of data? When data with several memory addresses is converted into a flat description so that it can be sent to another computer over the network.

4.What is JSON? It is the widely used data storage and communication format for serialization over the web.

5.What are the differences between JSON and the way programmers write objects in plain Javascript?
JSON requires all property names to be in double quotes and only simple data expressions are allowed.

1 Like