Data Structures (Arrays and Objects) - Reading Assignment

  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers? When there is a need to access a sequence of values, then Strings and integers will not be effective. There would need to be a conversion step for the string for retrieving the value.
  2. What variable type can be used in order to solve the problem of storing multiple values? An array.
  3. What are properties in Javascript? Properties are values of objects (ie: length.string is the length value of the string object.)
  4. Which values do not have properties? Almost all JavaScript values have properties. The exceptions are 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. Both value.x and value[x] access a property on value—but not necessarily the same property.
    6 What are methods? Properties that contain functions are generally called methods of the value
    they belong to, as in “toUpperCase is a method of a string”
  6. What are objects? Values of the type object are arbitrary collections of properties. One way to
    create an object is by using braces as an expression.
  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)? Objects are created ‘on the heap’, a larger memory space in the computer, so they can be bigger. Primitives are created and managed on the stack (a smaller, limited, faster memory space), that is why they must be relatively smaller (booleans, integers and strings are more manageable in size). When an object is created, it gets a reference as well, which is created on the stack, that points to the actual object on the heap. That reference for the larger object on the heap, is what is passed around when referring to that object elsewhere in the code. This is a faster way to manage the larger objects, because the primitives are copied each time they are created (if you create var name = ‘tim’ and then make secondname = name and then rename name (name = ‘Chris’), after the renaming of name, if you console.log(secondname), you will get ‘tim’. Why? Because the statement name = ‘Chris’ created a new primitive on the stack, and secondname is still pointing to the first one, ‘tim’. This can be problematic, of course: Keeping track of what variables are printed to what primitives might make a mess, with regard to keeping track of them all. On the other hand, objects are simply passed around as references, so, in the same scenario, if you created obj1 {} and then made obj2 = obj1, now obj2 simply has a reference to the data for obj1 on the stack (the data for obj1 is on the heap). If you now change data in obj2 and console.log it, it will reflect the changed data immediately… because both obj1 and obj2 are simply using references, stored on the stack, which are pointing to the same data on the heap. Because objects may be very large, passing around references is obviously much more efficient (faster).
  8. How do you define an object? You can use braces as an expression.
  9. What can you say about the mutability of Javascript objects? strings, integers, numbers and other ‘primitives’ values are not changeable. That means that they are ‘immutable.’ Objects are mutable (they can be changed).

SECOND PART:

  1. Why can’t you add new properties to a string variable? Strings are immutable.
  2. What are rest parameters? Rest parameters allow a function to take in an indefinite number of arguments and condense them into 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? Serialisation is the method by which the data/program that you are trying to send over the network from your computer to another is ‘flattened’ (versus sending your computer’s memory over the network and all of the references that you have in the current state that your computer has regarding the program … a rather strange way to transmit information).
  5. What is JSON? JSON is the ‘flat version’ of the data on your computer that you are trying to send over the internet to another computer. Since the current state of the program on your computer (before the flattening) is a tangle of addresses in memory, data within each address, and the references that you have to each address, there needs to be a standardized way to complete the process of ‘flattening’ such that any computer that receives it will recognize the format and be able to translate it into a working program on the destination computer. This is what JSON accomplishes, it stands for JavaScript Object Notation.
  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. 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 needs to store multiple values in a single variable.

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

  3. What are properties in Javascript? They are are expressions that access a property of some value of a variable.

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

  5. How can we access properties in a value (two ways)? value.x returns the property of value named “x”. value[x] tries to evaluate the expression x and uses the result, converted to a string, as the property name.

  6. What are methods? Methods are properties that contain functions. They are are generally called methods of the value they belong to, as in “toUpperCase is a method of a string".

  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)? The objects are type of variables extremely flexible to rappresent the entity in a the real world because the structure of an object, its properties and methods, can be freely defined so we can coding using variable with an higher level of abstraction than other values types.

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

let client = {
         name: "Mario",
         surname: "Rossi", 
         orders: [ ord909, ord1041, ord357] 
};
  1. What can you say about the mutability of Javascript objects? It’s possible to change an object’s property, 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? A string variable is not objects and thei properties are immutable.

  2. What are rest parameters? Rest parameters are bound to an array containing all additional arguments given to a function.

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

  4. 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 the tangles of memory addresses, related to an object, to a description that can be stored or sent. A solution is serialize the data, that means it is converted into a flat description.

  5. What is JSON? JSON (JavaScript Object Notation) is a popular serialization format that 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? In a JSON file comments are not allowed and 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.

  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 that can store multiple values.

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

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

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

  4. How can we access properties in a value (two ways)?
    value.x and value[x]

  5. What are methods?
    Properties that contain functions are generally called methods of the value they belong to. For example in toUpperCase () is a method of a string.

  6. What are objects?

A JavaScript object is 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 solve the need to store different data types

  1. How do you define an object?

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

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

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

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    They are not treated as Objects.

  2. What are rest parameters?
    rest parameters allow us to call any number of arguments from input data, they allow us to not specify an exact amount of data to be called for.

  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 an object to a string of characters or bytes, the use case is to transmit the object across the network or store it or replicate it to another similar is slightly different object.

  5. What is JSON?
    JSON is JavaScript Object Notation, It is a form of serialization and allows for faster communication among different programs

  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, comments or anything that involves actual computation are not allowed.

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 introduces a functionality in which you would like one object, or day, to have multiple values such as if you turned into a squirrel and what activities you did that day. You want all of these values to be related only to the day that you specify. Strings and integers do not have this functionality.
2. What variable type can be used in order to solve the problem of storing multiple values?
Arrays can store multiple values.
3. What are properties in Javascript?
The attributes of a certain value.
4. Which values do not have properties?
null and undefined
5. How can we access properties in a value (two ways)?
You can use the dot “.” and also square brackets to access properties in a value.
6. What are methods?
Properties which contain functions.
7. What are objects?
Objects are a value type 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 can store different data types.
9. How do you define an object?
Objects contain a list of properties, along with values for each property. You can create a object using brackets.
10. What can you say about the mutability of Javascript objects?
Objects can have their properties changed.

1. Why can’t you add new properties to a string variable?
Strings only have a certain number of properties and which are immutable.
2. What are rest parameters?
Rest parameters use three dots so that any number of arguments can be accepted.
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 converts data into a flat description. This allows you to save data for later or sent it to another computer on the network.
5. What is JSON?
JSON stands for Javascript Object Notation. It is used as a data storage and communication format on the internet.
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 computation. Comments are also not allowed.

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 can only hold a specific data type at any one time, this works well when thinking in terms of pure categories of data, for example specific types of nuts that the squirrel likes to eat, wallnuts for instance but what if we want to include other types of food and their quantities that can be eaten in one sitting? The data collection methods need a more complex form of storage to allow for more data types and their attributes to all be included into one location for reference. An artificial variable can be created to emulate the requirement to fulfill this need from the programmer, but the programmer will be required to do more code and access several variables to return the data. Javascript solves this issue by using arrays which allow for different types of data and categories or sets of data to be mix together giving a single reference for were the data is help. This increases the speed of the program by having a allocated part of the stored data together on the hard disk, it also reduces the the amount of code required to access the data and add to the data, which also reduces the potential for errors and bugs. Arrays play a large role in creating a structure for a program that leverages on the computing power of the computer it’s running on and also allows programs to propagate the data that is still to be found without the need for declaring the size of a variable.

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

Arrays are one variable type capable of storing multiple values.

3. What are properties in Javascript?

Every time a variable has data pushed into it, it gives the programmer the ability to access some of the meta data that is associated to the data, such as the type of data, the size of the data, the character symbols of the data. All these extra data parts can be accessed by the programmer to do searches in the array to build new sets of data. It’s important to consider that when a program is connected to an already established source of data, like a map for instance, that the first action will be to try and collect as much relevant data that is need to support the request of the user, once the initial data is collected it can be used to build other sets based on similar properties of the data/variables that are already stored.

4. Which values do not have properties?

It’s possible that arrays can exist without being filled with data, this is usually the case when the program starts, and as the program continues to load it will collect the data required into the array. The issue come that sometimes there are gaps in the array as the data was not found or the data was removed at some point, if the program tries to access a “gap” in the array, it will return an error. The error indicates that the referenced point of storage does not have any data and will return a “Null” value. In this case the Null value does not have any properties, beside it being empty to start with.

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

Depending on the purpose of the program, the value holds different properties. The most obvious property is the value itself, and that value can be analyzed to give more properties to see if it meets the search requirements to be included in the next or other set of array that might be created. Javascript makes this process quicker by inherently having ways called methods which allow the programmer to initialize function to extract the properties of the values directly, this reduces the code required and therefor increases the speed of the program. To access the direct property of an array the [] should be used, to access the methods to retrieve properties that need to be calculated we use methods wish initialize with the “.” dot.

6. What are methods?

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

7. What are objects?

An object is a type of array, we know that an array is defined by the square brackets but the Object allows for arrays and other objects to be joined or bound together. It’s best to think of it like a subject of category, sometimes information from different schools of knowledge can be grouped together with other separate schools of knowledge, because we are crossing the boundaries and forcing these different types of data to exist together we need a more complex form of an array, this type of array is an object and it is defined by {} not square. The major benefit of this is that it can be passed as a complete package from one program to another and transformed into different languages to allow for cross platform integration.

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

Objects are special as they are able to hold as many different datatypes as we need.

9. How do you define an object?

Objects are defined as any other variable, with the value being a list contained within braces.

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

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

SECOND PART:

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

Strings, integers and booleans are basic types of variables also know as primitives, adding properties to variables is a new kind of concept. In the past it would be correlated with a id type set of variables and it was very easy for the entire system to get errors and become a mess. With Java things became more organized as the id type set for the variables became upgraded into objects, which Javascript adopted. Objects are mutable and can be altered, primitive variables are immutable and can’t be altered, but you can try and add new properties, nothing will happen though.

2. What are rest parameters?

This is a very useful feature in the event that a programmer is dealing with large volumes of data, meta data and don’t know the size of all the points of data that they will process, they can use an array to store all that information and then pass it onto a function. When they want the function to know that it’s an array of data and not just one variable three dots are placed in front of the array variable ….metaarray. This allows the function to repeat it’s process over and over until it’s gone through the entire array.

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

Applications store data were they run, it could be on the users computer or a server. The data is fragmented on the disk drives and referenced with index id’s for retrieval. Prior to Object Orientated programming these indexes needed to be handled by the programs on a very static interface through arrays. The benefit of OOP was that the indexing system became managed by the language and made it much cleaner and more efficient for programmers. The system that allows for OOP to function streamlined the indexes so that only on reference was needed to gain access to all the other values, but this system was not designed with it’s full potential until the idea of making these indexes intact with the data so that it could be transferred. When the indexes are reorganized with the data opposed just the reference indexes, this is called serialization of data allowing the information to be transferred across networks.

4. What is JSON?

There are many different ways to organize the data into a single packable and transportable way called serialization, JSON is one of those ways, but JSON has the major benefit of being simple enough for any operating system or platform to read it and it’s also has human readable attributes, while still being compact enough and easy to transport.

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

All property names need to be surrounded in double quotes and only simple data expressions are allowed. So no function calls, bindings, or anything that involves actual computation. Also, comments are not allowed, but JASON does allow for Javascript Functions to act on JASON so that data can be read/ removed / added directly to JASON through Javascript.

Part I

  1. A daily log implies to add new data everyday which is not possible with immutables variables like strings and numbers
  2. Arrays, objects and lists can solve the problem of storing multiple values
  3. Properties are caracteristics of an object
  4. null and undefined
  5. With dot notation or with square brackets notation
  6. Methods are functions for objects
  7. Objects are variables that can store multiple values (properties) and multiple functions (methods)
  8. Objects can store multiple values and their number can be modified, 1 object is like mutliple variables
  9. let object = {property1: true, property2: ‘This is a string’, property3: 3};
  10. JavaScript objects are mutables

Part II

  1. Because a string is immutable

  2. Rest parameters are arrays that allow a function (or a method) to accept multiple arguments with variability which means sometimes 2 other times 3 and so on.

  3. Serialisation is the operation to describe data in order to store it or send it.

  4. JSON means JavaScript Object Notation which a kind of serialisation

  5. JSON has 2 restrictions: 1) every property has to be double quoted 2) only simple data expressions are allowed

1.he needs a required variable than can store multiple values.
2.arrays and objects.
3.“are expressions that access a property of some value”
4.null and undefined.
5.e.g. value.x// value[x]
6.“methods are properties that hold function values.These are special kinds of functions that only work on the value they belong to”
7.Objects are considered collections of properties, inside object the user can store different value types.
8.Objects can store values of different types as integers, booleans, strings and arrays.
9.e.g. "var basketball = {color:“brown, size= 4}”
10.Users can change objects properties.Also:“there is a difference between having two references to the same object and having two different objects that contain the same properties”

SECOND PART:

1.Because string variables are immutable.
2.It is the use of any number of arguments in a function.
4.“Its the process whereby an object or data structure is translated into a format suitable for transfer over a network or storage”//“convert into a flat description.”
5.Json is a popular serialization format. It is used a lot as a data storage and communication format.
6.Properties should also be written inside double quotes.Json only allows simple values ezpression like strings, number, arrays and booleans.“So no function calls, bindings, or anything that involves actual computation.”

Reading Assignment - Data Structures (Arrays and Objects)

    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?
  2. Jacques needs a good data structure to store his data in a way that he can use it for further analysis. Arrays are good to store and categorize strings and integers. Functions are good for analysis.

  3. What variable type can be used in order to solve the problem of storing multiple values?
  4. Arrays are perfect. Arrays are a list of values.
    let  arrayname = [1, 2, 3, 5, 8];
    

  5. What are properties in Javascript?
  6. Every value has properties except null and undefined. To access property x the main ways is to use . or [].
    value.x  // x is property name (string)
    value[x]  // x is a evaluation of expression x
    

  7. Which values do not have properties?
  8. null and undefined.

  9. How can we access properties in a value (two ways)?
  10. value.x  // x is property name (string)
    value[x]  // x is a evaluation of expression x
    

  11. What are methods?
  12. Methods are properties that contain functions.

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

  15. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
  16. With Objects you can bind different types of values together. You can combine these type of values to structure your data.

  17. How do you define an object?
  18. Define a object by using braces as an expression
    let objectname = {
      squirrel: false,
      events: ["work", "peanuts", "jumping"]
    };
    
    let objectName = {
      propertyName1: value1,
      propertyName2: ["value2", "value3", "value4"]
    };
    

  19. What can you say about the mutability of Javascript objects?
  20. Object values can be modified. Not like other type of values (numbers, strings and booleans, they are immutable)

SECOND PART

  1. Why can’t you add new properties to a string variable?
  2. String variables are immutable like numbers and booleans.

  3. What are rest parameters?
  4. With rest parameters a function is accepting any number of an of one or more arguments.. Three dots before the function's last parameter.

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

  6. What is serialisation and what is a use case of serialisation of data?
  7. Serialisation is some kind of compressing format of JavaScript code to handle it easier in the web. It is a different way to of writing code.

  8. What is JSON?
  9. JSON is a popular serialization format. It stands for "JavaScript Object Notation". It is used as data storage and communication format on the web not just for JavaScript

  10. What are the differences between JSON and the way programmers write objects in plain Javascript?
  11. In JSON all property names have double quotes, no function calls, no bindings, or other thing that are involved in comutation, comments are not allowed as well

  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?*
    1. The ability to store sequences of values in a mutable way.

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

  3. What are properties in Javascript?
    3. Properties are the values associated with a javascript object. In other words, almost all JavaScript values have properties .

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

  5. How can we access properties in a value (two ways)?
    5. With a dot or a square bracket. When using a dot, the word after the dot is the literal name of the property. When using square brackets, the expression between the brackets is evaluated to get the property name. Whereas value.x fetches the property of value named “x”, value[x] tries to evaluate the expression x and uses the result, converted to a string, as the property name.

  6. What are methods?
    6. Methods (of the value they belong to) are Properties (of the value they belong to ) that contains functions.

  7. What are objects?
    7. Objects are containers for storing data values that have the ability to contain many values ( or, objects are values of arbitrary collections of properties), where the values are written as name:value pairs, separated by colon, within curly braces {}.

  8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
    8. objects (and arreys - which are a specific kind of object) allows for the values to be mutable - You can change their properties, causing a single object value to have different content at different times. Objects tend to use names for their properties and store more or less a fixed set
    of them. Arrays, on the other hand, usually contain varying amounts of conceptually identical values and use numbers (starting from 0) as the names of their properties.

  9. How do you define an object?
    9.See previous answer (7).

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

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    1. because strings are immutable and can not be changed.

  2. What are rest parameters?
    the rest parameter is bound to an array and containing any number of arguments which is relevant. (…).

  3. (Feel free to skip the sub-chapter of Math object and Destructing)
    I tried to learn some briefly.

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

4. 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. Therefore, We can Serialize the data- means to convert it into a flat description through the use of serialization format , used as a data storage and communication format on the Web .

  1. What is JSON?
    5.JSON=Java Script Object Notation- It is widely used as a
    data storage and communication format on the Web, even in languages other than JavaScript.

  2. What are the differences between JSON and the way programmers write objects in plain 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. 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?
    Store multiple values in one variable.
  2. What variable type can be used in order to solve the problem of storing multiple values?
    Arrays can be used.
  3. What are properties in Javascript?
    These are 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)?
    With a dot and with square brackets.
  6. What are methods?
    Properties that contain functions.
  7. What are objects?
    They 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)?
    They can store multiple properties like activities, booleans, etc.
  9. How do you define an object?
let objectA = {a: 1, b: 2};
  1. What can you say about the mutability of Javascript objects?
    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?
    Such values are immutable and cannot be changed.
  2. What are rest parameters?
    It can be useful for a function to accept any number of arguments. 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?
    That means it is converted into a flat description to save for later or use on another computer.
  5. What is JSON?
    A popular serialization 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.

1st

  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 didn’t do large Data sets. The Data & Array structure bring a perspective & corresponding tools on how to perceive & relay the data.
  2. What variable type can be used in order to solve the problem of storing multiple values? Arrays
  3. What are properties in JavaScript? a property is an association between a name (or key) and a value.
  4. Which values do not have properties? Null & Undefined.
  5. How can we access properties in a value (two ways)? Dot & Square Braces
  6. What are methods? JavaScript methods are actions that can be performed on objects. A JavaScript method is a property containing a function definition. Property. Value.
  7. What are Objects? Objects are data structures that are capable of containing 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)? Hold different values in the same variable conveniently
  9. How do you define an object? let object1 = {value: 10};
  10. What can you say about the mutability of JavaScript objects? JavaScript only objects & arrays are mutable.

2nd

  1. Because a string is not an object.
  2. Rest parameters are 3 dots that represent an arbitrary number of parameters as the function input.
  3. Converting data into a flat description which makes it convenient to save data to a file.
  4. JSON stands for JavaScript Object Notation… is a popular serialization format. It is widely used as a data storage and communication format on the Web.
  5. JSON looks similar to JavaScript’s say 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 also not allowed in JSON.

Ivan on Tech
Part 1

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

A: storing multiple values could be a problem.

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

A: objects

  1. What are properties in JavaScript?

A: Almost all JavaScript values have properties, The exceptions are null and undefined if you try to access the property of one of these non-values you get an error.

4.Which values do not have properties?

null and undefined.

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

A: the two main ways to access properties in JavaScript are with a Dot and with Square Brackets.

6.What are methods?

A: Methods are nothing more than properties that hold function values.Properties that contain functions are generally called methods of value they belong to.

7.What are objects?

A: Objects are arbitrary collections of properties.When an object is written over multiple lines indenting it helps with readability.

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

A: Value of type string, numbers and Boolean are not objects and though the language doesn’t complain if you try to set new properties to them, it doesn’t actually store the properties.Such values are immutable and cannot be changed.Arrays on the other hand ,usually contain varying amounts of conceptually identical values and use numbers (starting from 0) as the names of their property. Object solve problem that require mutability.

9.How do you define an object?

A: objects lets you change their properties causing a single object value to have different content at different times.

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

A: There is no comparison operation built into JavaScript, which compares objects by contents, but it is possible to write it yourself.
Part 2

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

A:Such value are immutable and cannot be changed

2.What are rest parameters?

A:Rest Parameters can be useful for functions to accept any number of arguments

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

A: Serialization is the process of converting data into a flat description.

  1. What is J SON?

A: J SON is a popular serialization format and the acronym stands for java Script Object Notation.

5.What are the differences between J SON and the way programmers write objects in plain JavaScript?

A: J SON 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 computations, Comments are not allowed in J SON.

  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 can only store one type of data/values, while an array we can store multiple types of data/values.

  2. What variable type can be used in order to solve the problem of storing multiple values? An array and is written as a list of values between square brackets, separated by commas.

  3. What are properties in Javascript? Characteristics of the values.

  4. Which values do not have properties? The exceptions are null and undefined. If you try to access a property on one of these nonvalues, you get an error.

  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 of a value that contain functions are generally called methods of the value they belong to.

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

  8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)? They allow to hold and reference different types of values.

  9. How do you define an object? One way to create an object is by using braces as an expression. Inside the braces, there is a list of properties separated by commas. Each property has a name followed by a colon and a value.

  10. What can you say about the mutability of Javascript objects? The types of values such as numbers, strings, and Booleans, are all immutable—it is impossible to change values of those types. Objects work differently. You can change their properties, causing a single object value to have different content at different times.

  11. 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. As mentioned earlier, such values are immutable and cannot be changed.

  12. What are rest parameters? It can be useful for a function to accept any number of arguments. To write such a function, 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.

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

  14. What is serialisation and what is a use case of serialisation of data? Converting data stored in memory into a flat description of what that data is.

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

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

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 and extraxting them easily

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

Var = [] array

What are properties in Javascript?

Almost all values have properties except null and undefined. Properties can be lengt of a string positions in a array etc

Which values do not have properties? Null and undefined

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

Value.x or value.[x]

What are methods?

Properties that contain functions e.g toUpperCase

What are objects? A collection of properties , inside a brace we could give a variable many properties e.g a bolean expression and an array of values.

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 combine these , and hold as many data types as is needed

How do you define an object? By defining a variable and using and using brace {}

What can you say about the mutability of Javascript objects?

Objects can be changed by changing its properties

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

They are not objects , and their values are imutable and cant be changed

What are rest parameters?

Rest parameter gives possibiltiy of indfinete values in an array

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

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

The process whereby an object or data structure is translated into a format suitable for transferral over a network, or storage (e.g. in an array buffer or file format). Like using .jason format

What is JSON? Java script object notation similar to array but but properties are surrounded by “”

What are the differences between JSON and the way programmers write objects in plain Javascript? properties are surrounded by “” Instead of arrays

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

  2. ***What variable type can be used in order to solve the problem of storing multiple values?
    -An array data type. Ex: var = [] array

  3. ***What are properties in Javascript?
    Written as a list of values between square brackets separated by commas.

  4. ***Which values do not have properties?
    Almost every value has properties except for “NULL” & “UNDEFINED”.

  5. ***How can we access properties in a value (two ways)?
    Two ways we can access properties through a value is either through a period or square brackets. Ex: Value.x or Value[x]

  6. ***What are methods?
    Properties that contain functions of the value(s) they belong to.

  7. ***What are objects?
    Objects allow us to group values together and sort through them to produce more complex structures.

  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 like arrays can hold as many data types as it needs for a complex new structure.

  9. ***How do you define an object?
    Define a variable and defining its properties inside square brackets or after a period.

  10. ***What can you say about the mutability of Javascript objects?
    Objects can be change their properties if they aren’t immutable.

  11. ***Why can’t you add new properties to a string variable?
    New properties are immutable and aren’t considered objects.

  12. ***What are rest parameters?
    Are useful for a function to accept any number of arguments.

  13. ***What is serialisation and what is a use case of serialisation of data?
    Serialization-Process that converts data into a flat description, this makes it easier to save the data to a file.

  14. ***What is JSON?
    JavaScript Object Notation is a serialization format and is used as a data storage and communication format on the web.

  15. ***What are the differences between JSON and the way programmers write objects in plain Javascript?
    Property names are surrounded by double quotes, and only simple data expressions are allowed, no function calls, bindings, or anything that involves actual computation.

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?

Problem is causation - tying events to a particular outcome. An array is needed to store multiple events along with a single outcome.

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

Either an object or an array

  1. What are properties in Javascript?

Characteristics 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 dot “.” method or array notation []

  2. What are methods?

Actions/functions that can be performed on a values or objects

  1. What are objects?

A collection of values and properties

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

Objects can store one or more data types; Objects represent a complete system as opposed to a single property

  1. How do you define an object?

With braces and key/value pairs

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

Objects can be modified, unlike other types of Javascript data types

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

String variables are immutable

  1. What are rest parameters?

Rest parameters gather any number of elements into an array - used with … notation

  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?

Converting an object’s properties and values into string notation

  1. What is JSON?

JavaScript Object Notation - a common form of serialization; used for transferring and storing data

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

Double quotes around values, only simple data expressions are allowed, comments are not allowed



1 Like
  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
    The programs we have built so far have been limited by the fact that they were operating only on simple data types. This chapter will introduce basic data structures

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

  3. What are properties in Javascript?
    Properties are the values associated with a JavaScript object.

  4. Which values do not have properties?
    null, 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)?
    they solve the need to store different data types.

  9. How do you define an object?
    By putting it in curly braces.

  10. What can you say about the mutability of Javascript objects?
    When objects involved in the code, the mutability of the code is weaker. changes in the code must be done carefully.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    A string is not an object so it doesn’t have the ability to store new properties.

  2. What are rest parameters?
    Rest parameters allows us to represent any number of arguments as an array.

  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?
    Data converted into a flat description.

  5. What is JSON?
    JSON stands for JavaScript Object Notation and is a popular serialisation format used for data storage and communication on the web.

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON 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. 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 do all the same mathematics on different kind of values. You can’t do math on text as you can do with number 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?
    Character settings

  4. Which values do not have properties?
    NULLL

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

  6. What are methods?
    Functions

  7. What are objects?
    A collection 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)?
    An object can hold different values

  9. How do you define an object?
    By using {}

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

SECOND PART:

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

  2. What are rest parameters?
    gives possibiltiy of indefinite values in an array

  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?
    Converting an object’s properties and values into an other notation like a string or number

  5. What is JSON?
    Java Script Object Notation

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    [/quote]
    Property names are surrounded by double quotes.