Data Structures (Arrays and Objects) - Reading Assignment

  1. Strings and integers can only store a single type of data. The fix is a data structure capable of storing multiple values and types of data in order to keep everything organised.

2.The solution for storing multiple values are arrays.

  1. Proprieties are defined as a characteristic regarding values in data structures.

  2. Undefined and Null.

  3. Using a dot between the properties and the name of the properity, or using square brackets in which we write the expression.

  4. Methods represent proprieties that contain function values.

  5. Objects represent data structures that contain a variety of proprieties.

  6. Objects allow variables representing different types of data to be used and called upon.

  7. We can define objects the same way we do all variables, i.e. with braces and the values inside them are separated with commas.

  8. Objects can have the properties changed and can lead to a property having a different value at a point in time.

Second part:

1.Because a string variable is not a object and therefore it’s immutable.

  1. They are parameters in direct correlation with a array which have all the further arguments.

  2. Skipped. Thank God :rofl:

  3. Arrays and objects are stored as bits that hold addresses. They can be serialized in a data managament notation.

  4. JSON is a acronym that means JavaScript Object Notation. It represents data storage and communication.

  5. In JSON we can only input simple expressions, without 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?
    Scenarios where more than just a single number or string needs to be stored.

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

  3. What are properties in Javascript?
    These are expressions that access a property of a value.

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

  5. How can we access properties in a value (two ways)?
    Can use the convention:
    value.x
    or
    value[x]

  6. What are methods?
    Properties that contain functions.

  7. What are objects?
    These 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)?
    Additional values can be assigned and associated to values.

  9. How do you define an object?
    e.g.
    let descriptions = {
    work: “Went to work”,
    “touched tree”: “Touched a tree”
    };

  10. What can you say about the mutability of Javascript objects?
    Object values can be modified.
    Numbers, strings and Booleans are all immutable.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    This is because they are immutable.

  2. What are rest parameters?
    rest parameter 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. (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 memory addresses to a description that can be stored or sent.

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

  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. Storing multiple data into a string variable.
  2. You can use an array to store multiple values .
  3. Properties are the values associated with an object.
  4. null
  5. value.x or value[x]
  6. These are special kind of function where it only work on the value that it belong to.
  7. Object is the one that always has a key and a value in it.
  8. I think you can store multiple value in a key and it is much easier to read .
  9. First you have an object then your curly braces contain a key : value in it.
  10. You can change their properties, causing a single object value to have different content at different times.

Second Part

  1. Because string is not an object and they are immutable
  2. It can be use for a function to accept any number of arguments.
  3. That means it is converted into a flat description. Used as a data storage and communication format on the Web, even in languages other than JavaScript.
  4. JavaScript Object Notation is a serialisation format that is widely used today.
  5. First is you need to double quote all the property, Second is there is no function calls, bindings, or anything that involves actual computation, Third is you cannot use comment.
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 need to store structured data sets to combine and store multiple numbers, booleans and strings.

  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?
    Attributes of values which can be defined and called

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

  5. How can we access properties in a value (two ways)?
    value[x] - where x can be an expression which is evaluated before determining the value
    and
    value.x - where x is the name of the property

  6. What are methods?
    A property which contains a function e.g. .toUpperCase

  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)?
    It can combine other value type together to produce a data set

  9. How do you define an object?
    object = { property1: value1, property2: value2}

  10. What can you say about the mutability of Javascript objects?
    Objects are mutable, i.e. their properties can be changed, whereas other values e.g. strings, integers are immutable

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    Strings are not objects, so they are immutable

  2. What are rest parameters?
    Rest parameters are bound to arrays and will provide the number of items in that array as arguments to a function. It is a way of parsing any number of arguments to a function. They are denoted by putting 3 dots in front of the array and parsing that as an argument in a function.

  3. (Feel free to skip the sub-chapter of Math object and Destructing)
    The Math object provides a set of in number realted functions e.g. Math.min, Math.max to give the min/max values in an array. It means you don’t have to create your own functions for this.
    Destructing means using bindings to refer to elements in an array

  4. What is serialisation and what is a use case of serialisation of data?
    It means converting the data into a flat description so that it can be used or sent to another computer without having to send the memory of the computer.

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

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON does not allow comments, and property names must be surrounded by double quotes. It also does not allow any sort of computation e.g. function calls or bindings.

Please correct if I’ve made any errors!
These questions are challenging but definitely a good way to help solidify what I’ve learnt!

1 Like

PART ONE
1: handling of larger data sets and multiple logs of information.
2: Arrays are data set (arrays).
3:Properties can be either be Instance or Static. Instance properties hold data that are specific to a given object instance. Static properties are shared among all object instances.
4: null and Undefined have no properties.
5:Using the array.length or array[“length”]
6:Methods are properties that hold function values. These values are special functions only belonging to one specific value.
7: Objects can be data structures that are capable of containing a collection of properties. Adding Key/Value pairs separated by commas in a [ ] will create an array that would have “Objects/Elements”
8: Objects can hold many different datatypes so they are flexible for programming.
9: An Object is a variable that can contain an array with [ ] for even more values listed inside.
10: You can go back later and make changes with an object, unlike strings where you need to change the entire var itself.

SECOND PART:
1: A String is primitive therefore they are immutable.
2: Rest parameters are a syntax that lets an indefinite number of arguments be placed in an array.
3: Serialisation is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file.
4:JavaScript Object Notation. This is the Serialization format used for data storage and communication.
5: Property names must be surrounded in double-quotes and only simple data expressions are allowed.

1 Like

PART ONE

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?

Integers and strings are simple values, the atoms of a data structures. They are immutable, can’t be changed. In the weresquirrel example we would need to be able to put these values into a context with other data. We might also need to change these values. Also, we need to be able to store multiple values, namely a set of log entries that do not only consist of just numbers and strings but also a list of activities and a Boolean value that indicates whether J. transformed or not. Finally, we would need to group these entries into a single value and then put these grouped values into an array of log entries (objects).

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

Arrays. Arrays are variables with which we can store multiple/different values.

3. What are properties in Javascript?

A Javascript property is a characteristic of an object, often describing attributes associated with data structures.

4. Which values do not have properties?

The values ‘null’ and ‘undefined’ do not have properties.

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

With a dot (.) and with square brackets ([ ]). (value.x, value[x]

6. What are methods?

Methods are properties that contain functions. ( for example .toUpperCase, toLowerCase, .pop, .push)

7. What are objects?

Objects are standalone entities with an arbitrary collection of properties.

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

Objects are variables that can contain multiple values in form of properties (and property values) and methods. Objects allow to group and modify values (within objects). That’s not possible with other, primitive value types such as integer, string, array etc…

9. How do you define an object?

An object can be defined by using { } brackets to create an expression:
var = { key1: value1, key2: value2, …}.

Quotations will need to be added if the property’s name is not a valid binding or number.
var = { key1: “value1”, key2: “value2”, …}.

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

Whereas numbers, strings and Booleans are immutable, properties of objects can be changed, causing a single object value to have different content at different times.

PART TWO

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

Because the value types string, number and Boolean are not objects. If you try to set new properties on them, it doesn’t actually store those properties. Such primitive values are immutable and cannot bre changed/modified.

2. What are rest parameters?

The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions in Javascript. As such it is useful for a function that needs to operate on any number of arguments.

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

Serialization is the process whereby an object or data structure is translated into a format suitable (it is converted into a flat description) for transferal over a network, or storage (e.g. in an array buffer or file format). In JS you can serialize an object to a JSON string by calling the function JSON:

  • JSON.stringify() takes a Javascript value and returns a JSON-encoded string (convert to JSON)

  • JSON.parse() takes a JSON-encoded string and converts it to the value it encodes (convert data from JSON)

5. What is JSON?

JSON is a popular serialization format and stands for Javascript Object Notation. It is an open standard file and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute-value pairs and array data types. It is widely used as a data storage and communication format on the Web, even in languages other than JS.

6. 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: no function calls, bindings, or anything that involves actual computation, comments are also not allowed. Other than that JSON looks similar to Javascript’s way of writing arrays and objects.

1 Like

FIRST PART

  1. Jacques needs a variable that can store multiple values.

  2. Arrays.

  3. Properties are all the values associated with objects.

  4. null and undefined.

  5. value.x and value[x]

  6. Methods are actions that can be performed on objects. A method is a property containing a function definition.

  7. Objects are containers for named values called properties or methods.

  8. You can use objects to store as multiple datatypes.

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

  10. They can be changed.

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.

  2. Rest parameter is an improved way to handle function parameter, allowing us to more easily handle various input as parameters in a function. They are used to create functions that accept any number of arguments.

  3. Serialization process whereby an object or data structure is translated into a format suitable for transferral over a network, or storage. Serialization converts an in-memory data structure to a value that can be stored or transferred.

  4. A popular serialization format which stands for JavaScript Object Notation, used as a data storage and communication format on the Web, even in languages other than JavaScript.

  5. In a JSON file 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?
    Storing of multiple values and data types variable.

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

  3. What are properties in Javascript?
    Properties holds data (value) that are specific to a given object.

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

  5. How can we access properties in a value (two ways)?
    With a dot and with a square brackets.

  6. What are methods?
    Methods holds data (function) that are specific to a given object.

  7. What are objects?
    Objects are arbitrary collection of properties.

  8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
    Object allows s to group values including other objects to build more complex structures.

  9. How do you define an object?
    Objects are arbitrary collection of properties.

  10. What can you say about the mutability of Javascript objects?
    It gives more flexibility.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    Because strings is immutable.

  2. What are rest parameters? When such function is called.
    It can be useful for function to accept any numbers 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?
    Converted data in a flat description.

  5. What is JSON?
    A data serialization.

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    It similar to JavaScript with few restrictions, all property names have have to be surrounded by double quotes, no functions calls, bindings and comments, anything involves actual computation.

1 Like
  1. The problem happened only on days when he had been near oak trees. But avoiding oak trees did not stop the issue.

  2. He needs a data structure to store the information.

  3. JS provides a data type specifically for storing sequences of values. It is called an array and is written as a list of values between square brackets, separated by commas.

  4. Null and undefined.

  5. With a dot and square brackets in order to manipulate arrays.

  6. Copy of a string in which all letters have been converted to Uppercase or lowercase.

  7. When an object is written it indenting which helps with readability.

  8. The delete operator cuts off a tentacle from such an octopus.

  9. To find out what properties an object has, use Object.keys function and give an object and it returns an array of strings- the object’s property names.

  10. Similarly, though a const binding to an object can itself not be changed and will continue to point at the same object, the contents of that object might change.

1 Like
  1. In order to keep all kind of information organized , is needed a data structure to store this multiple info. That means solve the issue to work with different kind of data and values. In otther words, a variable wich can store multiple values.

  2. Arrays variable must be uses of storing multiple kind of values.

  3. Are the values associated to a object, almost all javascript values have properties.

  4. Undefined and null.
    5)The two main ways to access properties in JavaScript are with a dot and with
    square brackets.
    6)Properties that contain functions are generally called methods of the value
    they belong to.
    7)Values of the type object are arbitrary collections of properties. One way to
    create an object is by using braces as an expression.

  5. To store different data.

  6. An entity wich holds multiples values and methods

  7. Mutability is to change a value state after it is created, in javascript can be mutable objects, arrays.
    Second part"

  8. Because is an inmutable value and cant be modified as Booleans and numbers.

  9. It can be useful for a function to accept any number of arguments. For example,
    Math.max computes the maximum of all the arguments it is given-

  10. “The process whereby an object or data structure is translated into a format suitable for transferral over a network, or storage”

  11. As author said “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.” Is a serialization format.

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

PART 1

  1. The need to store multiple types of variables in a manner that conveys their relationship to each other.
  2. An array
  3. An expression of a value, giving it additional context
  4. “Null” and “undefined”
  5. The use of a dot ( . ) and square brackets ( [ ] )
  6. Properties that contain functions
  7. A collection of properties defined as a single value
  8. Gives us the ability to define a multi-polar set of values as a single value
  9. Using a set of braces ( { } ) as an expression
  10. Javascript objects allow flexibility in assignment of their properties, allowing cascading changes if the objects have been referenced with other objects

PART 2

  1. The properties on string values are immutable
  2. Allows a function to accept and indefinite number of arguments as an array
  3. Conversion of data sets into a flat description, best used for transferring data to a different system
  4. JavaScript Object Notation is used as a data storage and communication format
  5. In JSON, all property names must be encapsulated in double-quotes and no computation-based elements 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?

  • There is the problem of holding all sorts of data in different places.
  • There is a problem of not being able to change this data in the context of other data.
    – strings and integers by themselves are immutable which means they can’t be changed.

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

  • JavaScript provides a data type specifically for storing sequences
    of values. It is called an array.

3. What are properties in Javascript?

  • Expressions that access a property of some value.

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?

  • Methods are a number of properties that hold function values. 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)?

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

9. How do you define an object?

  • To create an object use curly braces as an expression.

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

  • Because javaScript objects are mutable, we can store large sets of normally unchangeable values, and change them in the context of other data. So, Object mutability is extremely useful.


THE SECOND PART:



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

  • If you try to add a new property, it doesn’t stick because string values are
    immutable and cannot be changed.

2. What are rest parameters?

  • a parameter of a function wherein you put three dots before the function’s last parameter, when such a function is called, the rest parameter is bound to an array containing all further arguments.

3. (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 process of converting data into a
    flat description. A use case for serialization is that instead of sending over your computer memory along with the data thats stored there, you can serialize it into a flat description.

5. What is JSON?

  • A popular serialization format is called JSON (pronounced
    “Jason”), which stands for JavaScript Object Notation. It is widely used as a
    data storage and communication format on the Web, even in languages other
    than JavaScript.

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. And also, comments are not allowed in
    JSON.
1 Like
  1. chapter introduce that cannot be solved with variable types such as strings or integers?

The problem cannot be solved with variable types such as strings or integers because he needs a data structure to store the information.

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

The variable type that can be used in order to storing multiple values is called an array.

  1. What are properties in Javascript?

Properties are the values associated with a JavaScript object. A JavaScript object is a collection of unordered properties.

  1. Which values do not have properties?

Almost all JavaScript values have properties. The exceptions are null and undefined.

  1. 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. Both value.x and value[x] access a property on value.

  1. What are methods?

Properties that contain functions are generally called methods of the value they belong to. Methods are functions that live in properties and (usually) act on the value they are a property of.

  1. What are objects?

Values of the type object 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)?

If you want to store for each entry a list of activities and a Boolean value that indicates whether is true or false, you need objects.

  1. How do you define an object?

Like this for instance:

let day1 = {

squirrel: false,

events: [“work”, “touched tree”, “pizza”, “running”]

};

or

let descriptions = {

work: “Went to work”,

"touched tree": "Touched a tree"

};

or

let anObject = {left: 1, right: 2};

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

Mutable is a type of variable that can be changed. In JavaScript, only objects and arrays are mutable, not primitive values. You can make a variable name point to a new value, but the previous value is still held in memory. Hence the need for garbage collection. A mutable object is an object whose state can be modified after it is created. Immutables are the objects whose state cannot be changed once the object is created. Strings and Numbers are Immutable.

SECOND PART:

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

Values of type string 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.

  1. 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. The rest parameter syntax allows us to represent an indefinite number of arguments as an array. With the help of a rest parameter a function can be called with any number of arguments, no matter how it was defined. When “…” is at the end of function parameter, it is the rest parameter. It stores n number of parameters as an array.

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

If you want to save data in a file for later or send it to another computer over the network, you have to somehow convert these tangles of memory addresses to a description that can be stored or sent. This is serialization. That means it is converted into a flat description.

  1. What is JSON?

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.

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

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.

  1. 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 the building blocks of objects.

  1. Which values do not have properties?
    The process of turning data into a format more suitable for transfer to another computer. This creates a flat description of the data rather than packaging and exporting the entirety of a computers memory to another user. The best known use case for this data manipulation technique is turning object properties (ie. their names + associated values) into JSON format so it is easily readable by other’s machines.

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

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

  4. What are objects?
    Objects are arbitrary collections of properties, which can hold different types of values. While in an Array we can only have one type of values, in Objects we can store every kind of values.

  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)?
    Problems requiring data structures comprised of arbitrary collections of properties (as with the weresquirrel example). Moreover, we need to use objects whenever we have problems that require us to be able to change properties. Objects are mutable so we can change their properties but the other value types we’ve learned so far are immutable; we cannot change the content of the value of those types.

  6. How do you define an object?
    Objects can be defined by curly brackets {}. When inputting object elements, we can follow the name:value pairing.

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

Objects being mutable gives us an opportunity to manipulate the properties of objects as we want and it gives us flexibility.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    String values have some built-in properties, such as length and toLowerCase, and you can even set new properties onto string variables. But these properties won’t be stored.

  2. What are rest parameters?

It can be useful for a function to accept any number of arguments. For example, Math.max computes the maximum of all the arguments it is given.

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

Converted data stored in memory into a flat description.

  1. What is serialisation and what is a use case of serialisation of data?
    Serilization is the process of storing informations from objects of a running application in a normalized format like JSON
    .5. What is JSON?

JSON is a standard, a norm, a datatype which is used to send data in a performant manor through the network. This format is widely used to do communication between different computers.

  1. 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 computation. Comments are also not allowed.

1 Like

1.You need a data structure to store and access all of the data.
2. Arrays can be used to store multiple values.
3. values inside objects
4. null & undefined
5. value.property or value[property]
6.Properties that contain functions.
7. An arbitrary collection of properties defined by the programmer using key/value pairs.
8. Being able to associate unrelated data.
9. With the let command and curly brackets
10. Object values can change.
PART 2
1.those values are immutable.
2. Allows functions to accept more arguments.
3. :robot: :robot: :robot:
4. Serialized data helps bring structure to our data and can be used to save and send data in computers.
5. It stands for Javascript Object Notation and is used as data storage and communications format for the web.
6. All properties names have to be surrounded by double quotes and only simple data expressions are allowed( No call functions, bindings or anything thatv involves 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?
You can’t save several values in the same variable.
2. What variable type can be used in order to solve the problem of storing multiple values?
An array storing all the separate values.
3. What are properties in Javascript?
A value stored in an object.
4. Which values do not have properties?
‘Null’ and ‘Undefined’
5. How can we access properties in a value (two ways)?
. notation or square brackets x[x]
6. What are methods?
Collection of properties with function values.
7. What are objects?
Variables that contain more than one 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)?
Objects can hold different multiple values of different datatypes.
9. How do you define an object?
Let x = {
x = x,
x = x,
x = x
};
10. What can you say about the mutability of Javascript objects?
JS allows values within an object to be changed.
P2
1. Why can’t you add new properties to a string variable?
String variables are immutable and can’t be changed.
2. What are rest parameters?
A rest parameter allows a person to put an indefinite number of arguments in a function.
3. What is serialisation and what is a use case of serialisation of data? A use case would be sending data over a network.
Changing complex data into a flat file.
4. What is JSON?
JSON stands for JavaScript Object Notation and is a popular serialization format on the Web.
5. What are the differences between JSON and the way programmers write objects in plain Javascript?
All properties must be surrounded in double quotes.
Only simple data expressions.
No comments.

1 Like
  1. This chapter introduces data structure, needed when we have multiple strings and/or integers values we want to store and keep track of. It helps organizing multiple single data values.

  2. JavaScript provides a data type specifically for storing sequences of values. It is called an array and is written as a list of values between square brackets [], separated by commas ,.

  3. Properties are specific characteristics that values have, such as length, the index of a value, the min and max math operator of a value, etc.

  4. undefined and null.

  5. We can access to properties in a value by a dot value.x and square brackets value[x].

  6. Methods are properties that contain functions of the value they belong to.

  7. Objects are arbitrary collections of properties.

  8. In this Weresquirrel situation, we need entries that do not just consist of a number or a string—each entry needs to store a list of activities and a Boolean value.
    Objects allow us to group these together into a single value and then put those grouped values into an array of log entries.

  9. Objects are defined like any other variable, using braces as an expression.

  10. Means that in JavaScript we can change object properties such as one single value can have different content at different times.

SECOND PART

  1. Because values of type string, number, and Boolean are not objects so the language doesn’t store those properties.

  2. We denote them as three dots ... before a function’s last parameter. They are useful for functions that accept any number of arguments. When such function is called, the rest parameter is bound to an array containing all further arguments.

  3. Serialisation means converting data into flat description. A use case can be when we want to save data in a file for later, or send it to another computer over the network.

  4. JSON (JavaScript Object Notation) is a (popular) serialisation format. It’s widely used as a data storage and communication, 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 inJSON.

1 Like
  1. This chapter introduces problems such as data tracking , organization of code and grouping values. Just a string or number variable won’t solve those problems.

  2. Arrays.

  3. Properties give us deeper information about values , and they are used as ways of utilizing a value.

  4. Undefined and null.

  5. We can access properties by typing a dot or square brackets after the value and then put the property expression we want.

  6. Methods are properties that contain a function’s definition.

  7. Objects are a collection of properties combined in a value.

  8. Object properties can be changed and modified unlike the other value types.

  9. An object is a collection of properties .

  10. In JavaScript the user is able to change the object’s properties. This isn’t possible with strings , integers etc. Also objects with the same properties might not be equal , because in object equality what matters is the object’s identity.

Strings and properties answers :

  1. We can’t add new properties to strings , because they are not objects and also are immutable.

  2. Rest parameter is a triple dot syntax , which allows putting multiple values with a single expression.
    Rest parameters can be used as functions , to nest arrays etc.

  3. Serialization is a process in which data is translated into a transferable format . Serialization is used to store object and data memory , so when the data is lost it can be restored.

  4. JSON is a data format used for serializing data.

  5. The difference is that in JSON property names have to be surrounded by double quotes , and only simple data expressions are allowed . Also comments are not allowed in JSON.

1 Like

First Part
1 The problem such as organization and grouping of values
2 Arrays are used
3 Properties provide more information about values and allow us to use values in a variety of ways
4 undefined and null don’t have properties
5 Via square or dot notation
6 methods are properties that contain functions of the value they belong to
7 Objects are collection of properties that are combined into a value
8 object properties can be changed/modified
9 collection of properties
10 programmer can change the object’s properties.

Part 2

1 string variables can’t be changed
2 Rest parameters allow us to put an indefinite number of arguments inside a function
3 Serialization converts data into a flat file
4 JavaScript Object Notation. It used mainly used as a data storage and communication format on the internet
5 JSON looks more similar to JavaScript’s way of writing array and objects.
6 JSON property names must have double quotes and only simple data expressions are allowed. There are also no comments in JSON.

1 Like

Part 2:

  1. You cannot add new properties to a string variable because they are immutable.

  2. Rest parameters are in the a functions parentheses (…) which is bound to an array with further arguments .

  3. Skipped :stuck_out_tongue:

  4. Serialization allows data structures to be translated into a stream of bits for storage or transfer.

  5. JSON(Javascript object notation) is a representation of serialized data.

  6. Simple expressions only. No functions, bindings, comments etc.

1 Like