Data Structures (Arrays and Objects) - Reading Assignment

FIRST PART

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

SECOND PART

  1. Values of type string are not objects and immutable.

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

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

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

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

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

1 Like
  1. 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?
    SIngle data types it can not story multiple data point of a value.

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

  3. What are properties in Javascript?
    Properties are characteristics of a value.

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

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

  6. What are methods?
    Methods are properties that contain a function.

  7. What are objects?
    Objects are groupings of data for a given 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)?
    They allow for multiple data points to be contained in a value.

  9. How do you define an object?
    let anObject = {User; “tesla”, score:99};

  10. What can you say about the mutability of Javascript objects?
    Javascript objects can be changed, making javascript objects mutable.

SECOND PART:

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

A string is a value there, for it is immutable.

  1. What are rest parameters?
    Rest parameters are used to call all possible data in an array to find a value.

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

  3. What is serialisation and what is a use case of serialisation of data?
    Serialisation converts data into binary bits that allow the data to be converted into string and value using JSON.

  4. What is JSON?
    JSON is a way to convert into a flat description. Allowing it to be transported and stored more efficiently

  5. What are the differences between JSON and the way programmers write objects in plain Javascript?
    In JavaScript, arrays and objects data are stored as addresses in a computer’s memory. Jason converts these addresses into binary code.

1 Like

Part1

  1. The weresquirrel has the problem that it needs variables that stores multiple values.
  2. arrays can store mulitple values
  3. properties are values which are defined in an object
  4. null and undefined
  5. properties can be accessed with a dot . or with [] e.g. array.length or array [“length”]
  6. Methods are properties that contain functions
  7. Objects are a collection of properties
  8. Objects can store value of different types
  9. let description = {work: “Went to work”, pizza: 2} ;
  10. Objects can change their properties - that is the mutability.

Part2

  1. strings are immutable - so they can not change their properties.
  2. the rest parameter means: when you call a function that you get all arguments which are already bound to the array.
  3. i should read the questions before reading the book :frowning:
  4. serialize: to convert it into flat description. It means to convert data structure or object state into a format that can be stored.
  5. JavaScript Object Notation - is a serialization format.
  6. JSON --> all property names have to be surrounded by “” and only simply data expressions are allowed - no functions calls, no bindings, … and no comments
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?
our friend needs a way to input different sets of data that can be represented as an array. However, the data cannot be used or manipulated like normal string or integers

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

3. What are properties in Javascript?
Almost all Javascript values have properties, they define characteristics about the values in a data structure

4. Which values do not have properties?
The values that do not have any properties are “null” & “undefined”

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

6. What are methods?
Methods are properties that hold function values.

7. What are objects?
Objects are data structures that are capable of containing 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 can hold as many different data types as required

9. How do you define an object?
With a value being within a list contained within braces

10. What can you say about the mutability of Javascript objects?
Mutability of objects means that the values they contain CAN be changed. Different from datatypes such as strings, numbers and Boolians that CAN’T be changed

SECOND PART:

1. Why can’t you add new properties to a string variable?
Because a string is a primitive type. This makes it immutable

2. What are rest parameters?

  1. (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?
    The serialisation of data means that it is turned into a flat description. This makes it easier when saving data or transferring data/files to other computers

5. What is JSON?
Javascript Object Notation. A popular serialisation format

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

All properties must be surrounded by double-quotes. Only simple data expressions are allowed. No calls, bindings or anything that requires computation

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

Strings and Integers can only hold a specific type of information for example a string does not hold key/value pairs the same way as an array and to get the information from the string you would need to split or splice the string where in an array you can utilise the index to call the value.

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

An Array.

  1. What are properties in Javascript?

Most javascript values have properties the only ones that do not are Null and Undefined, what it means is for example a string value may be “The Cat Sat” and with this value you can check properties such as length.

var string = “The Cat Sat”;

var length = string.length;

console.log(length);

Prints “11” which is a property of the value;

  1. Which values do not have properties?

null and undefined

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

in the answer to three I have provided a way to show how a property in a value can be accessed this is by getting the variable “string” and calling the property by placing .length to it and this enables the property to be provided, another way is using square brackets on an array of data and calling the array plus square brackets enclosing an index.

  1. What are methods?

a method is a property that holds a function for a type of value. they are special kind of function.

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

  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 are able to hold key/value pairs which enables the holding of integers, booleans, strings and arrays.

  1. How do you define an object?

by declaring a var and using curly braces to hold the information/data required in key/value pairs style.

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

They are able to be changed after being defined for example with an array objects can be pushed to them, unlike some others like strings that are set to what they were originally defined as.

SECOND PART:

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

A string is immutable it can only hold the initial definition that it was provided.

  1. What are rest parameters?

rest parameters are able to hold all arguments they are denoted by the ellipses which is represented as three dots (…).

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

Skipped

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

serialization means that data is converted to a flat description of itself.

  1. What is JSON?

JavaScript Object Notation and it is utilised in flattening data for the purposes of communicating and send data files.

  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

FIRST PART
1- It introduce the need to store different type of data on the same variable. As well as, having an arbitrary collection of properties into one variable.

  1. The variable used is the “object”.

  2. So properties are methods that are created inside the object class.

  3. There are only two, which are the “null” and “undefined”.

  4. We can access them by using a “.” after the name of the object or using square brackets.

  5. Methods are properties that contains functions.

  6. Objects are a type of data used to store an arbitrary collection of properties.

  7. They allow us to create different types of properties.

  8. By using braces after the name of the variable, likewise:

var car = {
manufacturer: “BMW”,
model = “M3”
}

  1. The point is that objects allows us to change their properties, unlike what happens with strings, for instance.

SECOND PART:

  1. The reason why is because they are not objects, values of type string are immutable and therefore can’t be changed.

  2. Rest parameters are used when one want to pass this parameters as separate arguments to a function. Triple dot are the notation used to declare these type of parameters.

  3. Serialisation is a procedure that allow us to convert a kind of memory addresses into a flat description.

  4. JSON stands for JavaScript Object Notation and is a serialization format, used as a data storage and communication format on the web.

6.The main difference is that on JSON object properties names have to be surrounded by double quotes.

1 Like
  1. You need a to be able to store multiple values.

  2. Arrays make it possible to store multiple values.

3.Properties are used to call on certain traits of values. For example you may want to to split a string then join it back together. In order to do this you would use the properties .split and .join.

  1. Null and undefined are values that have n properties.

  2. You can access a property of a value by putting a dot in front of the property. eg. array.length
    Or you can use square brackets and place them around the the property of the value. eg. array[“length”)

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

  4. Objects allow us to group values so that we can build more complex structures.

  5. Objects can store different data types.

  6. An object is a collection of properties.

  7. The mutability of objects allow room for flexibility.

Second part

  1. String values are not like objects. They are immutable.

  2. Rest parameters allow us to represent any number of arguments, making it into an array.

  3. Serialization is when you convert data stored in memory into a flat description.

  4. Json or Javascript object notation is widely used as a storage data and communication format on the web.

  5. Json can except only simple expressions, whereas objects are immutable.

1 Like

P1

  1. The problems are that there is a need to store the data gathered in a way that the variables can bind to multiple values.

  2. We can use arrays to store multiple values.

  3. Properties in Javascript are the values held by an object.

  4. Null and undefined do not possess properties.

  5. We can access values of properties by using expressions using the dot “.” or square brackets [ ].

  6. Methods are the functions stored in the properties.

  7. Objects are the containers of various properties.

8… Objects are able to be changed whereas the other value types are immutable.

  1. We define an object by using the curly braces after defining the variable.

  2. Javascript objects are able to be altered after their input. Once we create the object data can be taken out and placed in. The opposite is true for boolean values and strings.

P2

  1. Because strings are immutable.

  2. Rest parameters are used to view all data in an array.

3

  1. Serialization is the conversion of data that can be saved or transported to be deconstructed and understood by the/another computer. A use case for serialization is when one wants to send such data across the web.

  2. Javascript Object Notation (JSON) is a serialization format popular for data storage and transport across the web.

  3. In JSON all of the property names are surrounded by double quotes and only simple data expressions are permitted. Function calls, bindings, and comments for example are not allowed.

1 Like

First Part

  1. It introduces problems where one would need to store a sequence of values into the computer´s memory.
  2. In order to store multiple values we would use an array.
  3. The values associated to an object in Javascript.
  4. Null and undefined values do not have properties and will return an error.
  5. The two ways to access properties in a value are through a dot or square brackets after the value name. value.propertyName or value[“propertyName”]
  6. Methods are functions as properties contained in an object.
  7. Objects are an arbitrary collection of properties of the value.
  8. Objects are more flexible as they allow for multiple values to be grouped.
  9. They are defined by placing a list of key:value pairs, separated by commas, in between braces.
  10. That values in objects can be changed, while other value types cannot. (Numbers, strings and Booleans would be immutable)

Second Part

  1. Because strings are an immutable value type.
  2. It allows us to more easily handle various input as parameters in a function. The rest parameter syntax allows us to represent an indefinite number of arguments as an array.
  3. Skipped.
  4. To convert data into a flat description. It is used to store and transfer data over the web.
  5. A popular serialization format called JavaScript Object Notation. It is widely used as a data storage and communication format on the Web, even in languages other than JavaScript.
  6. "All property names have to be surrounded by double quotes and only simple data expressions are allowed—no function calls, bindings, or anything involving actual computation. "
1 Like
  1. The problem that this chapter introduces is how one logs in data as a list. The data structure needed for this section is an array.

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

  3. Properties are accessed using value.prop or value[“prop”]. Objects tend to use names for their properties and store more or less a fixed set of them.

  4. The values of null and undefined do not have properties.

  5. Properties are accessed using value.prop or value[“prop”].

  6. Methods are properties that contain functions. For example, the push method adds values to the end of an array and the pop method does the opposite , removing the last value in the array and returning it.

  7. Values of the type object are arbitrary collections of properties. One way to create an object is by using braces as an expression.

  8. Objects solve the problem of having their value arbitrary collections of properties.

  9. An object is a variable with many values. It has a method and properties.

  10. Javascript objects have the means to change their properties, causing a single object-value to have different content at different times.

Part II:

  1. New properties cannot be added to a string variable because it is not an object. A string is immutable once it is ran.

  2. The rest parameter syntax allows us to represent an indefinite number of arguments as an array. A functions’s last parameter can be prefixed with ... which will cause all remaining (user supplied) arguments to be placed within a “standard” JavaScript array. Only the last parameter can be a “rest parameter”.

  3. Serialization is when data is converted into a flat description. It’s the process whereby an object or data structure is translated into format suitable for transferal over a network, or storage (e.g in an array buffer or file format).

  4. A popular format is called JSON, which is widely used as a data storage and communication format on the Web, even in languages other than Javascript. You can serialize an object to a JSON string by calling the function JSON.stringify().

  5. All property names have to be surrounded by double quotes, and only simple data expressions are allowed-- no function calls, bindings or anything that involves actual computation. Comments are not allowed in JSON.

1 Like
  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 problem solution involves creating a log of events that include multiple data types such as a boolean and a list of activities. And all the items are also a list or array.

  1. What variable type can be used in order to solve the problem of storing multiple values?
    object or user defined class and array that each of these objects are stored.

  2. What are properties in Javascript?

Properties are like data members of a class, attributes on html tags, key/value pairs in JSON. properties can be added to objects, the property key is some unique string of characters and associated with that is a value.

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

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

dot notation
objectName.property
person.age

index notation
objectName[“propertyname”]
person[“age”]
x = “age”; person[x]

  1. What are methods?
    methods are functions that act on a object. In a class definition you can implement members that act on the instance data of a class such as getters and setters.

  2. What are objects?
    Objects are like variables they are containers for data values but objects can contain many values

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

objects can be defined as an arbitary collection of different values or other objects where base types are of one type. object like person can have different attributes:name, address, phone, email etc. There is no way a language can have a special veriable type for every possible application.

  1. How do you define an object?
    Two ways: 1] using a function to create and return the object. or 2] using the class keyword and creating a class templat or prototype then using the new command. that calls the constructor.

  2. What can you say about the mutability of Javascript objects?
    java primatives are referenced by value so thier properties are immutable. objects are all by references. objects propertes can be added or modified so these are considered mutable.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    strings are considered immutable. so you can change the properties.

  2. What are rest parameters?
    rest parametrs are the last parameter in a function that is preceeded with a … and are used to define number of parameters at the end of a function call as part of an array that is then assigned to the rest parameter.

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

  4. What is serialization and what is a use case of serialization of data?
    serialization is used to crate a data set that is only data (no computations) and is needed when transmitting the data over to other programs, transmission over the internet or data-storage.

  5. What is JSON?
    JSON = JavaScript Object Notation. Json is the format for serialization of objects so they can be transmitted betwen programs. it is also very human readable.

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

JSON properties need to be always in “” or ‘’ where JavaScript a property name can be a string of characters without spaces and special characters

1 Like

Part One:

  1. Storing values with multiple instances and different types.
  2. Array
  3. Properties are traits associated with values.
  4. null & undefined
  5. using a period or square brackets
  6. Methods are predetermined functions included in the jQuery library.
  7. Objects are containers that contain multiple variables with their own unique set of values and properties.
  8. you can change the values inside them at any time
  9. by binding it to a name and wrapping it’s parameters inside curly braces.
  10. It is possible to change values inside an object.

Part Two:

  1. Because it is immutable
  2. Rest parameters allow us to represent an indefinite number of arguments as an array.
  3. okay
  4. Serialization is a method that allows us to convert Javascript data into data appropriately formatted for JSON.
  5. JSON is a data language that allows us to store data outside of our Javascript code allowing us to save computer memory
  6. All parameter values must be inside double quotation marks instead of single
1 Like

PART 1

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

being able to store different value types to bindings

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

arrays

  1. What are properties in Javascript?
    properties
  2. Which values do not have properties?

an object’s values

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

either after a . ( value.prop )
or in bracket ( value[prop] )

  1. What are methods?

properties that include functions

  1. What are objects?

data structures capable of holding collections of different types of data

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

being able to change the values where value types cannot be (are immutable)

  1. How do you define an object?

an object is defined in curly braces after the name you’re assigning it

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

objects are mutable - they allow us to change their properties

PART 2

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

string variables are immutable

  1. What are rest parameters?

rest parameters allow you to place an arbitrary number of parameters

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

skipped, for now

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

serialization is converting values held in a computer’s memory to a flat value, capable of being transmitted over the web

  1. What is JSON?

JSON = JavaScript Object Notation; it is a serialized form of the values held in a JavaScript object

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

all property names must have double quote marks, there are no function calls - nothing that involves computation

1 Like
  1. different types of datas and values which needs a data structure.

  2. Arrays

  3. all JavaScript values have properties, in fact properties are defining characteristics of values.
    Such as length.

  4. null and undefined

  5. value.x or value[x]

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

  7. Values of the type object are arbitrary collections of properties.

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

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

  10. only in objects we are able to change values later on. any other values such as string will always remain the same.

Part 2:

  1. A string is not an object but a primitive type, so they are immutable.

  2. t is the use of any number of arguments in a function.

  3. sure

  4. Serialisation is used when you want to transfer your codes to somewhere else.
    It’s a conversion of codes to a flat description in a file.

  5. JSON 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. 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. Storing multiple data types grouped together into sets.

  2. Arrays can store multiple values, in a sequential list.

  3. Properties are associations between names or keys & values.

  4. null and undefined have no properties.

  5. We can access properties by using the dot . or the square brackets []

  6. If a properties value is a function, it is known as a method.

  7. Objects are arbitrary collections of properties and are useful because we can grasp the entire object and manipulate it at once.

  8. If we want to do statistical analysis on values it becomes difficult with using just strings. Each value must be in a box that can be directly accessed in order to access multiple values in one operation. With strings the individual values would first need to be extracted out, then organised according to the type of operation required. Lots of work!!

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

  10. You can change the properties of objects, causing an object to have different values at different points in time.

SECOND PART:

  1. Strings are not objects, and you cannot assign new values to them - they will not store new values.

  2. Rest parameters allow us to represent an indefinite number of arguments as an array.

  3. The math object is a container holding a bunch of different functionality.

  4. Serialization is to take data such as objects and convert them to a series of strings, in order to store them or send them efficiently.

  5. JSON is Javascript Object Notation and is a format for sending and storing data that is widely used on the internet today.

  6. Although functions or anything requiring computation is omitted, it is similar. Syntax is slightly different. All property names must be surrounded by double quotes. Only simple data expressions are allowed.

1 Like
  1. The ability to store only one data type, also more difficult to extract data from within a string to be used in a meaningful way.

  2. You can create an array with elements of different data types when you declare the array as an object.

  3. Properties describe characteristics about a value.

  4. Null and Undefined do not have properties and will return an error message.

  5. The two main ways to access properties in JavaScript are with a dot and with square brackets. Both value.x and value[x] access a property on value- but not necessarily the same property.

  6. Properties that contain functions are generally called methods of the value they belong to, as in “toUpperCase” is a method of a string.

  7. Values of the type object are arbitrary collections of properties. One way to create an object is by using braces as an expression.

  8. Objects are able to hold different data types and group them into a single value and then put those grouped values into an array of log entries.

  9. One way to define an object is by using curved braces as an expression.

  10. With an object you can change their properties, causing a single object value to have different content at different times. Other value types such as strings, numbers, and booleans are all immutable, it is impossible to change values of those types.

Part 2

  1. A string is immutable and its properties are already in their most primitive form and thus can not have new properties added.

  2. The rest parameter syntax allows us to represent an indefinite number of arguments as an array.

  3. Serialization of data means to turn it into a flat description. It is widely used for data storage and communication format on the web.

  4. JSON: JavaScript object notation is a serialization format.

  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.

1 Like

1.) The problem this chapter introduced is that variable types such as strings or integers can only hold a single kind of data. Jaques needs a method of storing various values and data sets in a data structure and log that information daily to create an accurate record of exactly when he is turning into a squirrel and deduce which variable in his lifestyle is responsible for triggering his squirrel like tendencies.
2.)An Array is a variable type that can be used in order to solve the problem of storing multiple value.
3.)Nealy all Javascript Values have properties and those properties define some attribute of the values within a given data structure.
4.) “null” & “undefined” are two values that do not have properties
5.) The two ways to access properties in JavaScript are with the .x and bracketed “x”
6.) Methods are properties that hold functions. These functions only work with the value they belong to.
7.)Objects are arbitrary collection of properties and allow you to store numerous properties as a group with a single value as an array.
8.)Objects allow you group numerous varying data types inside a single value and then place the grouped values in an organized fashion
9.)Objects are expressed in [ ] when they aren’t the start of a statement. Objects compartmentalize data arbitrarily into organized structures within values. The data inside the object can have varying data sets known as properties and are capable of being modified.
10.)Unlike other types of values such as numbers, strings, and booleans Objects are capable of having their values modified. Objects properties can be altered so that single object value can have different content at different times.

Part 2
1.) Because string type values are not objects and their properties are not stored.
2.)The rest parameter allows a function to accept any number of arguments.
3.)Serialization if the conversion of data into a storable formart that can be sent to another computer or over a network.
4.)JSON short for Javascript Object Notation is widely used data storage and communication format on the net.
6.) In JSON programmers are restricted to limited expressions and simple data expressions that require no intensive computation. Although writing arrays and objects is similar in to standard Javascript except all property names have to be surrounded by double quotes.

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 Problem is that we need to input different entries that need to be represented as an array.
  2. What variable type can be used in order to solve the problem of storing multiple values?
    Arrays
  3. What are properties in Javascript?
    Properties are values defined in an object
  4. Which values do not have properties?
    Null and undefined
  5. How can we access properties in a value (two ways)?
    either dot or [] so value.X or value[X]
  6. What are methods?
    properties that hold function values.
  7. What are objects?
    Objects are a 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)?
    with an Object we can have any number of properties with varying data type.
  9. How do you define an object?
    defined per the following keyword, assignment char and curly brackets:
    let objectX = {a: 1,b: 2,c: 3} // Letters are index and numbers are assigned values.
  10. What can you say about the mutability of Javascript objects?
    Mutability allows for the change of object properties.

//Part 2

  1. Why can’t you add new properties to a string variable?
    Not objects and so are immutable
  2. What are rest parameters?
    used to call all possible data in an array to find defined value
  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 onverts data into binary bits that allow the data to be converted into string and value using JSON
  5. What is JSON?
    Javascript Object Notation. used in flattening data for the purposes of communicating and sending files
  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    JSON can only except simple expressions surrounded by “”, whereas objects are immutable.
1 Like
  1. Storing a sequence of values.
  2. Array.
  3. Properties in JavaScript are characteristics that describe a value (e.x. length, max)
  4. Values “null” and “undefined” have no properties.
  5. We can access properties in two ways: “value.property” or value[“property”].
  6. Methods are properties that contain functions.
  7. Objects are collections of properties.
  8. Objects attach keys to values or arrays and group them together in one “item”.
  9. let objectA = {key1: value, key2: [value1,value2]}
  10. JavaScript objects are mutable. You can declare the binding using ‘const’ in order to fix it, though it will still allow to change the values inside the object.

SECOND PART:

  1. Because string is not an object and the properties you’ll want to add will not be stored.

  2. It is a syntax that allows for storing an indefinite number of arguments in a JavaScript array.

  3. Serialization of data is translating it into a flat description from a way it is stored in computer’s memory. It is used to facilitate data storage and communication.

  4. JSON is a popular serialization format. It stands for JavaScript Object Notaton.

  5. In JSON all properties’ names have to be surrounded by double quotes and only simple data expressions are allowed.

1 Like
  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
    Having a structured way to store and recall more complex digital data such as sequences of numbers.

  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 the values associated with a JavaScript object. Properties can usually be changed, added, and deleted, but some are read only.

  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 mains ways to access properties are with a dot and with square brackets.

  6. What are methods?
    Properties that contain functions are generally called methods of values they belong to. For example, toUpperCase is a method of a string.

  7. What are objects?
    Objects are variables that can contain many values or 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)?
    Allow grouping of arrays, strings and values together into a single value.

  9. How do you define an object?
    By using braces and separating the properties by commas. Each property then has a name followed by a colon and a value.

  10. What can you say about the mutability of Javascript objects?
    Properties of objects can be changed , causing a single object value to have different content at different times. The types of values discussed in earlier chapters, such as numbers, strings, and Booleans, are all immutable.

SECOND PART:

  1. Why can’t you add new properties to a string variable?
    A string value is immutable, meaning the text inside an existing string can’t be changed.

  2. What are rest parameters?
    The rest parameter function allows us to represent an indefinite number of arguments as an array.

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

  4. What is serialisation and what is a use case of serialisation of data?
    To convert data into a flat description that is easier for storage and sending.

  5. What is JSON?
    JavaScript Object Notation - a popular serialization format, also used in languages other than JavaScript.

  6. What are the differences between JSON and the way programmers write objects in plain Javascript?
    Looks similar but has a few restrictions in that all property names have to be surrounded by double quotes, only simple data expressions are allowed (no function calls, bindings, or anything that involves actual computation), and comments are not allowed.

1 Like