Data Structures (Arrays and Objects) - Reading Assignment

Data Structures (Arrays and Objects)

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 cannot easily access specific parts of strings or integers. Jacques needs to be able to store multiple values in a data structure. In this way he can keep track of data to determine which factors are causing the transformation to occur.

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

Array

What are properties in Javascript?

Properties are characteristics of a value. For example, myString.length.

Length is the property of the value of mystring.

Which values do not have properties?

Null & Undefined

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

. // value.x

and

[] // value[x]

What are methods?

Properties that contain functions are generally called methods.

They are accessed with the (.)

let myArray = [1, 2, 3];

myArray.push(4);

What are objects?

Objects are an abitraty collection of properties.

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

Objects can hold values of different datatypes.

They allow us to group a collection of different types of data into one object.

How do you define an object?

You define an object 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.

let car = {

wheels: 4,

driven: false,

speed: 150,

};

What can you say about the mutability of Javascript objects?

Unlike the data type of strings, objects enable for objects to be changed.

Object values can be modified causing a single object value to have different content at different times.

SECOND PART:

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

Strings are not an object. They do not store properties. They are immutable and cannot be changed.

What are rest parameters?

the rest parameter is bound to an array containing all further arguments.

Rest parameters enable for a function to accept any number of arguments. Additionally, the rest parameter is bound to an array containing all further arguments. To create a rest parameters, they are denoted by three dots prior to the last parameter

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

Serialisation is the conversion of saved data into a flat description. This enables the flexibility for the file to transfer within a computer and network easily.

What is JSON?

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

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. Also comments are not allowed in JSON.

1 Like
  1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
    The information which is requred to solve the problem need a more complex shape than simple variables
  2. What variable type can be used in order to solve the problem of storing multiple values?
    We can use array to solve this problem
  3. What are properties in Javascript?
    Additional information from given information
  4. Which values do not have properties?Null and undefined
  5. How can we access properties in a value (two ways)?
    value.x and value[x]
  6. What are methods?
    Methods are properties that contain function
  7. What are objects?
    Objects holds data
  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)?
    We can store different type of data and arrays in one object
  9. How do you define an object?
    We define an object with {} and the data is stored in key/value pairs named Properties
  10. What can you say about the mutability of Javascript objects?
    You can modify binding as well as information that variable refers
    /
    11.Why can’t you add new properties to a string variable?
    Because only objects can get new properties
  11. What are rest parameters
    It is called by typing " … " and show input name to show al possible inputs must be taken
  12. What is serialisation and what is a use case of serialisation of data?
    Serialisation is process of conveting data to a flat description and its used for data storage and communication format on the web
  13. What is JSON?
    JSON stand for JavaScript Object notation and its a type of serialisating of data
  14. What are the differences between JSON and the way programmers write objects in plain Javascript?
    You must always use " " when you are writing property names and you cannot use anything that requres 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?

The issue of storing groups of values becomes much easier and negates the need for converting strings and numbers back and forth.

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

Arrays.

  1. What are properties in Javascript?

Properties are values associated with an object, for example an array.

  1. Which values do not have properties?

Null and undefined.

  1. How can we access properties in a value (two ways)?
    With a dot (.) and square brackets [ ]. Dot for single names and brackets for numbers or names eg John Doe.

  2. What are methods?

Methods are functions that pertain to the value they belong to. Eg: toUpperCase is a method that pertains to strings and Math.Max a method that pertains to numbers.

  1. What are objects?

Objects are arbitrary collections of properties.

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

Objects can change properties to have different single different content at different times. Whereas with integer, string, boolean the property content is immutable.

  1. How do you define an object?

Objects are completely unique and are only the same when one object is made equal to the other for example with the == sign. If, for example, two objects with different names have the same content they are not the same and will boolean to false.

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

Objects do allow their contents to be changed.

SECOND PART:

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

Because strings, numbers and booleans are not objects and therefore are immutable.

  1. What are rest parameters?

A rest parameters are parameters that are bound to specific functions and their arguments within that particular function. They are commonly called with three dots …

  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?

Serialization is a way of storing separate computer memory data expressions into a recoverable “flat” description format. The data expressions must be simple with no function calls, bindings or computations. As well, not comments are allowed. Use cases include saving a file for later or sending it through a network to another computer.

  1. What is JSON?

JavaScript Object Notation. A serialization format for data storage and communication for the Web.

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

All property names must be surrounded with double quotes and only simple data expressions are allowed. JSON data or values must be converted into a JSON string and then later deconverted with JSON.

1 Like

Part one

  1. The subchapter introduces the problem of needing some way to store multiple values in an organized way in some sort of DATA STRUCTURE.

  2. arrays

  3. Properties are a collection of mathematics related constants and functions.

  4. Only null and undefined have no properties

5.The 2 ways to access properties are with [] and .
6. Properties that contain functions are generally called “methods” of the value they belong too
7. Objects allow us to group values including other objects to build more complex structures.
8.Objects allow you to store multiple values in a single variable.
9. An object provide ways to group several values into a single value. Objects tend to use names for their properties and store more or less a fixed set
of them.
10. Object values can be modified so they are mutable. String, number, and boolean values are immutable or cant be modified.
PART 2:
1. Values of string, number and boolean are not objects and are immutable.
2. Rest parameters allow a function to accept any number of arguments by adding … before the last parameter.
3.Serialization is the practise of converting data into a flat description so it can be saved and loaded at another time or sent and loaded by another computer.
4. JSON is JavaScript Object Notation. It is the widely used format for serialization.
5. All property names must be surrounded by double quotes. Only simple data expressions allowed, No function calls, Bindings or anything that actually requires computation. 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? There are many variables at play, so he needs a layered data structure to collate all the variables in now place. Simple strings or integers don’t allow problem solving in a complex sequence of values.

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

  3. What are properties in Javascript? Each value in an expression has a property that can be expressed in terms of the noun calling it. Size, value, color, index number, length.

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

  5. How can we access properties in a value (two ways)? value.x or value[x]. Dot is the literal name of the property and brackets is the expression to be evaluated to get the property.

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

  7. What are objects? Objects in a set of braces [] are a way to group together some values within the same classification.

  8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)? Objects can be added to or items subtracted from. The can be a store of values, and called upon. They can store different types of values in a given object at the same time.

  9. How do you define an object?
    let anObject = {
    boolean: false,
    pets: [“dog”, “cat”, “bird”];
    numbers: [1, 2, 5, 8],
    }

  10. What can you say about the mutability of Javascript objects? Numbers, strings and booleans are immutable. Objects however can change values if we want them too. A particular value can have different values at different times and contexts.

SECOND PART:

  1. Why can’t you add new properties to a string variable? As they are immutable. The text cant be changed.

  2. What are rest parameters? They are used to allow functions to accept various input parameters no matter how they are defined. function functionname[…parameters]

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

  4. What is serialisation and what is a use case of serialisation of data? It is converted to a flat description for data storage and communication on the Web. JSON.stringify and JSON.parse are used to convert the format. They can then be sent to another computer.

  5. What is JSON?JavaScript Object Notation.

  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, nothing that involves a computation.

1 Like

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?
Arrays can store chunks of information that is easy to extract.

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

What are properties in Javascript?
They are different parameters in the values

Which values do not have properties?
null and undefined

How can we access properties in a value (two ways)?
with a dot or with square brackets

What are methods?
Properties that contain functions

What are objects?
It is a collection 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 are special as they are able to hold as many different datatypes as we need.

How do you define an object?
You can see them as
long, flat octopuses with all their tentacles in a neat row, labeled with numbers.

What can you say about the mutability of Javascript objects?
Objects are mutable: it means you can change their properties. But in strings or numbers for example you are not able no do that so they are immutable

Why can’t you add new properties to a string variable?
They are not objects and are immutable

What are rest parameters?
A method for a function to accept any number of arguments.

What is serialisation and what is a use case of serialisation of data?
It is when data is converted into a flat description. It is used to send data from one computer to another.

What is JSON?
JavaScript Object Notation - serialization format

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?
    To work with a chunk of data.

  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?
    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 dot or square brackets.

  6. What are methods?
    Properties that contain functions.

  7. What are objects?
    Values with 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)?
    Object values can be modified. The types of values discussed in earlier chapters, such as numbers, strings, and Booleans, are all immutable —it is impossible to change values of those types.

  9. How do you define an object?
    By using braces as an expression.

  10. What can you say about the mutability of Javascript objects?
    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 are immutable and cannot be changed.

  12. What are rest parameters?
    Is the way for a function to accept any number of arguments

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

  14. What is serialisation and what is a use case of serialisation of data?
    It is convert data into a flat description. It use case is data storage and communication format on the Web.

  15. What is JSON?
    A popular serialization format.

  16. 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. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers? He needs a variable type that can store multiple values and keep them organized and easy to access.

  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? the values associated with an object.

  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 that can be used to manipulate arrays.

  7. What are objects? value types that can contain 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 many different data types.

  9. How do you define an object? by using curly brackets, properties inside are named followed by a colon and a value

  10. What can you say about the mutability of Javascript objects? object values can be modified, causing a single object value to have different content at different times

  11. Why can’t you add new properties to a string variable? these values are immutable and cannot be changed because the properties don’t get stored

  12. What are rest parameters? called using three-dot notation, they are bound to an array containing all additional arguments given to a function

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

  1. What is serialisation and what is a use case of serialisation of data? serialization is converting data into a flat description to transfer over the network or for storage.

  2. What is JSON? JavaSript Object Notation, a widely used data storage and communication on the web, including in languages other than JS.

  3. 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 expression are allowed - no function calls, bindings, computations. or comments.

1 Like
  1. Problems in which you require storing multiple values in a single variable.
  2. arrays
  3. Properties are expressions to retrieve characteristics of values.
  4. null & undefined
  • when you have the name of the property: value.property
  • when the name of the property comes from another variable or does not look like a valid binding name: value[expression to return property name OR invalid binding name]
  1. Methods are properties that contain functions for the value they belong to.
  2. Objects are arbitrary collections of properties.
  3. Unlike arrays, objects can store multiple values of different data types.
  4. Objects are defined between braces, wherein properties are separated by commas.
  5. The properties of an object are mutable.

SECOND PART

  1. New properties won’t be stored in a string variable as it is immutable.
  2. Rest parameters are the ones that accept any number of arguments. These parameters are identified with three dots before its name (only the last parameter).
  3. Serializing data is converting it to a flat description.
  4. JavaScript Object Notation is a serialization format.
  5. In JSON property names have to be surrounded by double quotes, only simple data expressions are allowed (nothing that involves computation) and comments are not allowed.
1 Like

FIRST PART:

  1. Variable types can only store a single type of data. Jacques needs a more complex data structure that can store multiple values and data types. He also needs this data to be organized.
  2. an array
  3. They are certain attributes of some value.
  4. null and undefined
  5. We can access properties with a dot (value.x - x being the property we’re looking for) and with square brackets (value[x]). The difference is that with value.x we look for the property of value named x, whereas with value[x] takes the expression x and uses the result converted to a string as the property name.
  6. They are properties that contain functions.
  7. It’s a collection of properties.
  8. They can group together values of different types.
  9. Like any other value, with the values seperated by commas inside braces. ( let nameOfObject = {value, value, … , value}; )
  10. The values of objects can be changed. This is not the case with other data types such as strings which always keep the same value they are defined with at the start.

SECOND PART:

  1. Because a string variable is immutable and cannot be changed.
  2. Rest parameters accept any number of arguments.
  3. ok :grin: :+1:
  4. Conversion of data into a flat description. It helps with transferring and storing data.
  5. It is a serialization format. It stands for JavaScript Object Notation.
  6. JSON requires all property names to have double quotes around them and only simple data expressions are allowed.
1 Like
  1. introduces a way to store chunks of data in an easier manageable way than with strings, where one would have to assign multiple values to each string.
  2. Arrays
  3. they are the properties of the value e.g. .length, .math.max
  4. null and undefined
  5. value.x and value[x]
  6. Properties that contain functions of the value they belong to. e.g. toUppercase
  7. An object is a value that contains arbitrary collection of properties
  8. Objects can store value of different types
  9. with braces [ ]
  10. strings, intergers and boolean themselves are the value whereas, the object value contains properties within it that can be changed

Second part

  1. strings, intergers and boolean themselves are the value whereas, the object value contains properties within it that can be changed.
  2. Rest parameters are bound to an array, which contains all further arguments. This allows functions to allow any number of arguments.
  3. Serialization take a data set and converts it to a single name (flat description). It is used as a data storage and communication format on the web
  4. JSON is the name of the format (see 4). It stands for JavaScript Object Notation
  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

Part 1

  1. This chapter introduce the need of a data structure that is capable of storing multiple values and datatypes.
  2. We can store multiple values using an array.
  3. Properties are the values associated with a JavaScript object.
  4. The exceptions are null and undefined.
  5. The two main ways to access properties in JavaScript are with a dot and with square brackets: 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. A method is a property containing a function definition.
  7. Objects are arbitrary collections of properties, values of the type object.
  8. Objects give you the flexibility to group more than one data type into a single value.
  9. An object can be defined by using braces as an expression.
  10. Object values can be modified. You can change their properties, causing a single object value to have different content at different times.

Part 2

  1. Because the values of a string are immutable and cannot be changed.
  2. Rest parameters are bound an array containing all further arguments. They are used to make functions accepts any numbers of arguments.
  3. Serialisation is converting data to a flat description. The use case is 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 serialization format.
  5. JSON looks similar to JavaScript’s way of writing arrays and objects, with a few restrictions. All property names have to be surrounded by double quotes, and only simple data expressions are allowed—no function calls, bindings, or anything that involves actual computation. Comments are not allowed in JSON.
1 Like

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 or integers are simple data types that usually only contain one value. However problems which include large amounts of data or sets of data can not be solved with string or integer variables, we must use arrays.

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

What are properties in Javascript?
propeties are things like length of values or min max in a group of values, or they can be user defined such as color, size etc in an array.

Which values do not have properties?
null and undefined.

How can we access properties in a value (two ways)?
by using square brackets or dot. when using dot the word after the dot is the name of the property which you want to retrieve the value, where as with square brackets the value in the brackets is evaluated to get the property name.

What are methods?
methods are properties that contain functions, dependent on the value they belong to such as strings or integers. eg toUpperCase is a method of a string. where as push method adds values to the end of an array.

What are objects?
objects are an arbitrary collection of properties. Objects can be created by using curly brackets or braces.

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 multiple different types of values including other objects, arrays, strings, booleans. They can be used to group many values together in a single value

How do you define an object?
by using curly brackets, inside the brackets define the property name in quotes or not, then a semi colon then the property value as a string or integer, separate property values with a comma.

What can you say about the mutability of Javascript objects?
basic values such as boolean, strings, numbers, are immutable, meaning the values of these items cannot be changed. eg if you have a string “cat” it is impossible for other code to change it to “rat”.

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

What are rest parameters?
(Feel free to skip the sub-chapter of Math object and Destructing)
rest paramaters make so a function can accept any number of arguments. it can be implemented by putting 3 dots ie … in front of a parameter eg function max(…x){}

What is serialisation and what is a use case of serialisation of data?
to convert data into a flat description

What is JSON?
JSON short of JavaScript Object Notation is a form of serialization which is iwidely used as a data storage and communication format on the Web, even in languages other than JavaScript.

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

1 Like
  1. In order to fully understand the variables that alter his condition he needs to form a database, organising multiple variables. Strings and integers are only able to contain single types of data.

  2. Arrays and Objects

  3. properties are what characterises a value or element. They can be called to perform a specific function that is related to its characteristic

  4. Null and undefined

  5. value.x or value[x]. 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

  6. They are a way to access values. A method is a property containing a function definition.

  7. It is a collection of properties and are created by containing the value/key in braces {}

  8. Typical variable types are simple in nature. Objects are able to hold as many different data types as needed

  9. Named variable, which defines the values contained in braces. The braces describe the object

  10. Objects in JS have the ability to be muted and/or changed causing a single object value to have different contents at different times

SECOND PART

  1. Because strings are not objects, they are immutable and cannot be changed.

  2. It is the use of any number of arguments in a function and is denoted with an ellipsis (…)

  3. In order for objects and arrays to be digitally communacted and stored efficiently they must be serialised which breaks down the addresses of objects and arrays to be stored as bits.

  4. JSON is a serialisation, data storage and communication format on the web. It is not exclusive to JavaScript

  5. All property names are surrounded in double quotes, and only contain simple expressions. It cannot compute function calls, bindings or complex expressions

1 Like

First Part:

  1. Variable types like strings and integers are only capable of holding a single type of data.

  2. Arrays are capable of storing multiple values.

  3. Properties in javascript define a specific characteristic about the values in the structure.

  4. Null and undefined are values that do not have properties.

  5. Properties can be accessed using square brackets with the expression between the brackets being evaluated to get the property name. Also, properties can be accessed by using a period and the name of the property.

  6. Methods are properties that hold function values and are a unique type of function that only work on the value they belong to.

  7. Objects are data structures that contain an arbitrary collection of properties.

  8. Objects are unique as they have the ability to hold as many different datatypes needed.

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

  10. The mutability of javascript objects means that the values they contain can be altered or changed.

Second Part:

  1. A string is a primitive type so they are immutable.

  2. Rest parameters are useful for functions that accepts any number of arguments. For example, when a function is called the rest parameter is bound to an array containing all further arguments.

  3. Serialisation entails converting data stored in memory into a flat description of what that specific data is. This process is useful when saving the data to a file or transferring the data to another network.

  4. Javascript object notation is a serialisation format widely used for data storage and communication.

  5. The difference is that all property names need to be surrounded in double quotes and only simple data expressions are allowed.

1 Like

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?
Arrays can store chunks of information that is easy to extract.

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

What are properties in Javascript?
They are different parameters in the values

Which values do not have properties?
null and undefined

How can we access properties in a value (two ways)?
with a dot or with square brackets

What are methods?
Properties that contain functions

What are objects?
It is a collection 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 are special as they are able to hold as many different datatypes as we need.

How do you define an object?
You can see them as
long, flat octopuses with all their tentacles in a neat row, labeled with numbers.

What can you say about the mutability of Javascript objects?
Objects are mutable: it means you can change their properties. But in strings or numbers for example you are not able to do that so they are immutable

Why can’t you add new properties to a string variable?
They are not objects and are immutable

What are rest parameters?
A method for a function to accept any number of arguments.

What is serialisation and what is a use case of serialisation of data?
It is when data is converted into a flat description. It is used to send data from one computer to another.

What is JSON?
JavaScript Object Notation - serialization format

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? — sometimes we need data structures where we define our own attributes and inherent functions as built in data structures like strings and arrays.
  2. What variable type can be used in order to solve the problem of storing multiple values? — Arrays
  3. What are properties in Javascript? — values of attributes in a data structure like length or max or min in an array
  4. Which values do not have properties? — null
  5. How can we access properties in a value (two ways)? Using . Like string.length or using . In an object like array[]
  6. What are methods? Functions built into the data structure
  7. What are objects? Value types of 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 multiple properties of different types
  9. How do you define an object? Arbitrary collection of properties
  10. What can you say about the mutability of Javascript objects? You can change properties of objects
1 Like
  1. Why can’t you add new properties to a string variable? — There are primitive, not objects, hence immutable
  2. What are rest parameters? Using … , these parameters can be used for functions that accept any number of arguments and is for calling all 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? —- to convert into a flat description
  5. What is JSON? — a popular serialization format, JavaScript Object Notation, widely used as 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 properties surrounded by double quotes, only simple data expression allowed, no function calls or bindings or anything involving computation, and no comments
1 Like

Part 1

  1. The were squirrel has too much information to keep track of with just strings or integers. He requires a data set using arrays.

  2. Arrays are a variable type used to stope multiple values.

  3. Properties describe characteristics of values used in Javascript.

  4. Null and Undefined values do not have properties.

  5. Properties in value can be accessed in two ways. One way for example is using the code ‘array.property’. The second way is using the code ‘array[“property”]’

  6. Methods are a property that holds function values and only work with the value they are attached to.

  7. Objects are a collection of properties in which values can be stored within.

  8. An object can store different data types within itself.

  9. Use curly braces to define an object.

  10. Javascript objects are mutable, meaning they can be changed afterwards.

Part 2

  1. A string variable is not an object and will not allow you to add new properties.

  2. A number of parameters can be passed and evaluated in a function with rest parameters. They can only be used as last parameter by putting three dots in front of the name and are bound to an array.

  3. skipped

  4. Serialization converts data into a flat description. It does so, because it is more efficient than sending over the complete data.

  5. JSON is known as JavaScript Object Notation serialization format.

  6. Differences between JSON and plain Javascript include property names needing to be surrounded in double quotes and only simple data expressions are allowed. For instance, you cannot do function calls.

1 Like
  1. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers? storing multiple values in one variable.
  2. What variable type can be used in order to solve the problem of storing multiple values? arrays
  3. What are properties in Javascript? characteristics
  4. Which values do not have properties? null
  5. How can we access properties in a value (two ways)? value.x and value[x]
  6. What are methods? properties that contain functions
  7. What are objects? a unit within a program
  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)? properties can be added, removed and created.
  9. How do you define an object? by placing the value pairs separated with a comma within braces.
  10. What can you say about the mutability of Javascript objects? the object values can be changed

part 2

  1. Why can’t you add new properties to a string variable? because they are immutable
  2. What are rest parameters? arbitrary parameters that a function places within an array
  3. What is serialisation and what is a use case of serialisation of data? converting an objects state to a string.
  4. What is JSON? a standard text format often uses for serialization
  5. What are the differences between JSON and the way programmers write objects in plain Javascript? JSON is much simpler and does not have functions and does not perform computations.
1 Like