-
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 needs to be a collection of properties that describe the state and behaviors of an object. -
What variable type can be used in order to solve the problem of storing multiple values?
Array -
What are properties in Javascript?
States of objects -
Which values do not have properties?
null and undefined -
How can we access properties in a value (two ways)?
[ ] or . -
What are methods?
Behaviors of an object that are defined by functions that belong to that object. -
What are objects?
A collection of behavior and state using properties and methods that are grouped into a single value. -
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âre mutable. They can be modified over time. -
How do you define an object?
let obj = { } -
What can you say about the mutability of Javascript objects?
They allow for more flexibility
SECOND PART: -
Why canât you add new properties to a string variable?
Itâs immutable and cannot be changed. -
What are rest parameters?
method accepts all parameters given using â(âŚparameter)â -
(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?
converting data into a flat description -
What is JSON?
a popular serialization format that stands for javascript object notation -
What are the differences between JSON and the way programmers write objects in plain Javascript?
all property names are surrounded by double quotes & only simple data expressions are allowed
- Objects allow us to group values, as well as other objects, together in order to build more complex structures.
- Properties pertain to a certain value. Ex: myString.length would correspond to the length property of the value in myString.
- Values that are undefined or null do not have properties.
- We can access properties with either a dot or square brackets. Ex: value.x or value[x].
- Methods are properties that contain functions.
- Objects are variables that contain more than one value. Indicated by braces that contain a list of key/value pairs separated by commas.
- Value types such as integer, string, array, and Boolean do not store new properties, but are only able to be set to new ones. Objects allow for us to actually store these new properties.
- You can define an object by using curly braces. Inside the braces is a list of properties which are separated by commas. Each property has a name followed by a colon and a value
- Numbers, strings, Booleans, are all immutable. This means that these values cannot be changed by further lines of code. The mutability of objects allows for the programmer to program the object to have different properties at different stages of the program.
Part 2:
- You cannot add new properties to a string variable because they are immutable by nature, and therefore, cannot be changed.
- Rest parameters allow you to pass either a smaller number of arguments or a greater number of arguments than the formal parameter specified.
- Serializating data means to convert the data into a flat description, or, to convert tangles of memory addresses to a description that can be stored or sent.
- JSON stands for JavaScript Object Notation. It is a popular serialization format which is widely used as a data storage and communication format on the web, even in languages other than Javascript.
- It is similar to javascript but 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 either.
- Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
This chapter introduce problem of storing multiple values under one variable.
- What variable type can be used in order to solve the problem of storing multiple values?
It can be array or object.
- What are properties in Javascript?
Properties determine the state of an object in JavaScript. Almost all JavaScript values have properties. It can determine all sorts of information like length of a value, colour, etc.
- Which values do not have properties?
There are only two exceptions that havenât got properties and those are ânullâ and âundefinedâ. If you try to access a property on one of these nonvalues, you get
an error.
- 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.
- 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â.
- What are objects?
A JavaScript object is an entity having state and behaviour (properties and method). For example: car, pen, bike, chair, glass, keyboard, monitor etc.
- 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 properties and methods. We can not do that with other value types weâve learned so far.
- How do you define an object
A JavaScript object is an entity having state and behaviour (properties and method). For example: car, pen, bike, chair, glass, keyboard, monitor etc.
- What can you say about the mutability of JavaScript objects?
You can change objectâs properties, 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?
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.
- What are rest parameters?
The rest parameter is bound to an array
containing all further arguments. If there are other parameters before it, their
values arenât part of that array.
- (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?
Serialisation is a conversion of data in to a flat description. It is use to save data in a file for later or send it to another computer online.
- What is JSON?
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.
- 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.
- Data Structures
2.An Array - Properties define some characteristics of a value
- Null and Undefined
- by using a dot and name of the property or square brackets
- Methods are properties that hold function values
- Objects are data structures that are capable of containing an arbitrary collection of properties.
- Objects can hold as many data types as we need.
- Just like any other variable, with the value being a list inside braces
- The values contained in Javascript objects can be changed
1.String values are not objects
2. Rest parameters accept any number of arguments
3. (âŚ)
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.
-
The problem that needs solved is how to store a sequence of values so that the individual values are accessible.
-
Arrays are used to solve the problem of storing multiple values by storing them in an array and indexing each value within the sequence of values.
-
A value can be said to have properties, for example, .length can be used to determine the length of a string. The values stored in an array are considered to be the properties of the array.
-
Values that have no properties are null and undefined.
-
Properties in a value can be accessed using a dot (.) or by using square brackets ([ ]).
-
Methods are properties that contain functions, for example, toUpperCase is a method of a string which returns a copy of a string with all the letters converted to upper case.
-
Objects are collections of properties that can in turn be stored in an array as a collection of objects.
-
Objects allow a collection of values to be stored as a single value within a collection of other collections of values stored as single values, all while allowing us to access and modify the original values.
-
Objects are defined using braces, { }. Inside the braces is a list of properties separated by commas. Each property has a name followed by a colon and a value.
-
JavaScript objects are considered to be mutable and they can be modified, meaning a single object value can have different content at different times. Numbers, strings and Booleans are considered immutable and although their values can be combined to derive new values their original value remains unchanged.
PART TWO
-
Values like numbers, strings and Booleans are immutable, therefore you canât add new properties to them.
-
A rest parameter allows a function to accept an indefinite number of arguments as an array. Only the last parameter in a function definition can be used and it must be prefixed with three dots (âŚ)
-
Serialisation is the process of translating data structures or objects into a form that can be stored, transferred and reconstructed later. Possible use cases include messaging or data storage.
-
JSON is an acronym for JavaScript Object Notation. It is a popular serialisation format and it is used in client-server communication in web applications.
-
JSON looks similar to JavaScript but differs in that all property names are surrounded by double quotes and only simple data expressions are allowed. Function calls, bindings, anything that involves computation and comments are not allowed.
1.Forming data structure for collecting and store data with an array
-
Arrays
-
The elements in the array
-
Null and undefined
-
With a dot ore square brackets, like value.a and value [a]
-
Methods can manipulates arrays in mane ways
-
Object are all the properties inside the array or brackets8 Objects can be evaluated as a collection and can be modified versus the others named they are immutable
-
Object
cow
is all the dairy products in the cold storage that can have different properties from day today -
Objects are easily changeable, can have the same properties, and separate life etc.
2.P
- String properties are immutable and cannot be changed
- The rest parameter is as the name indicates the last argument of the function. It allows you to pass small our large numbers of arguments to the function and is always prefixed with three dots.g properties are immutable and cannot be changed
- âŚ
- Serialisation is the encoding of JS data of all kinds, to be transported to other computers where decoding takes place
- JSON is a serialisations format called, JavaScript Object Notation
- The whole JS data is pact in âŚ.curly brackets with double quotes ,comma, etc. to be decoded by the new user (computer)
-
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 need more complex tools to store all the data needed to run the program. -
What variable type can be used in order to solve the problem of storing multiple values?
Objects. -
What are properties in Javascript?
Different elements in a variable are its properties. -
Which values do not have properties?
null, undefined -
How can we access properties in a value (two ways)?
By dot.example or by using square brackets. -
What are methods?
functions associated to a valueâs property -
What are objects?
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)?
We can store many properties in one variable. -
How do you define an object?
by using curly brackets and giving a name and a value separated by colon -
What can you say about the mutability of Javascript objects?
objects are mutable. -
Why canât you add new properties to a string variable?
string are immutable -
What are rest parameters?
Ability to represent specific parameters and any number of arguments as 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?
conversion of data into flat descriptions; it helps with storing and sending data -
What is JSON?
JavaScript Object Notationâused for data storage and communication -
What are the differences between JSON and the way programmers write objects in plain Javascript?
All property names have to be surrounded by double quotation marks and only simple data expressions are 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?
What our friend needs is a data structure that is capable of storing multiple values and datatypes in order to keep all of the information organized.
2. What variable type can be used in order to solve the problem of storing multiple values?
Arrays or objects are one variable type capable of storing multiple values.
3. What are properties in Javascript?
Properties are expressions that access a property of almost all JavaScript value.
4. Which values do not have properties?
Null and undefined are the exceptions that do not have properties.
5. How can we access properties in a value (two ways)?
Properties in a value can be accessed using a dot and the literal name of the property. e.g. array.length
Properties can also be accessed using square brackets, with the expression between the brackets being evaluated to get the property name. e.g. array[âlengthâ]
6. What are methods?
A method is a property that holds function for a type of value. For example the
.push method adds values to the end of an array.
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)?
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?
A string is not an object but a primitive type, so they are immutable.
2. What are rest parameters?
These are denoted by a functionâs last parameter with 3 dots before its name and are useful for functions that accept any number of arguments. When the function is called, the rest parameter is bound to an array containing all further arguments.
3. What is serialisation and what is a use case of serialisation of data?
Serialisation is converting data stored in memory into a flat description of what that data is. It is useful for when we want to do things like saving the data to a file or transferring it to another computer on a network.
4. What is JSON?
JavaScript Object Notation is a serialisation format widely used for data storage and communication.
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 in JSON.
- Jaques want to store multiple records in one place in order to keep track of his actions. So he cannot do that with just one variable (maybe he could with a delimited string but that could be very impractical),
but he rather needs a container where he can dump multiple variables. - One of the data structures that could solve his issues could be an array.
- Almost everything in JS is an object. Properties are values inside the definition of these objects the characterize them.
-
null
andundefined
-
object.property
orobject["property"]
- Methods are functions that are defined as part of an object.
- Objects are the foundational data structure of JS which can store an arbitrary number of any JS object, in the form of key:value pairs.
- Compaired to other complex data structures, objects have the ability of storing an arbitrary number of elements of any type, and it is possible to design any kind of hierarchy in your data. Searching is also done in constant time once the key to access the data is known.
let object_name = {key1 : value1, key2 : value2, ...}
- Primitives (non-object types) are immutable. Bool, string, number, null and undefined
------- SECOND PART ---------
-
Strings are primitives and cannot be mutated or have their properties changed.
-
It is a function mechanism that allows any number of parameters to be used as function arguments.
-
-
-
Serialization is the transformation of data stored into your memory into a format that can be transferred and stored to the disc which later can be reloaded into the memory without losing any information.
-
JSON have some restrictions compared to vanilla JS objects. More particulartly:
- All property names have to be surrounded by double quotes
- Only simple data expressions are allowed that do not require any computation
- Comments are not allowed
- 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?
- What variable type can be used in order to solve the problem of storing multiple values?
Strings and integers cannot store multiple values in a variable, like array. So arrays are needed for more complex matters.
-
What are properties in Javascript?
Properties are characteristics of values, for example length of value, or index of value. -
Which values do not have properties?
Null and undefined does not have properties -
How can we access properties in a value (two ways)?
Either value.prop or value[âpropâ]. -
What are methods?
Methods are functions that live in properties and (usually) act on the value they are a property of. -
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.
eg
let day1 = {squirrel: false, events: [âworkâ, âtouched treeâ, âpizzaâ, ârunningâ]
};
console.log(day1.squirrel);//=> false
eg
let objectA = {a: 1, b: 2};
Object.assign(objectA, {b: 3, c: 4});
console.log(objectA);
// â {a: 1, b: 3, c: 4}
-
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)?
Types of values discussed in earlier chapters, such as numbers, strings, and Booleans, are all immutable,
object values can be modified.You can change their properties, causing a single object value to have different content at different times -
How do you define an object?
Values of the type object are arbitrary collections of properties -
What can you say about the mutability of Javascript objects?
It opens up new ways to solve problems with more complexity , because strings , numbers does not allow changes to their values.
SECOND PART:
-
Why canât you add new properties to a string variable?
The programming language does not allow it. -
What are rest parameters?
Itâs a function that accepts any number of arguments , it is the part <âŚwords > in below code
let words = [âneverâ, âfullyâ];
console.log([âwillâ, âŚwords, âunderstandâ]);
// â [âwillâ, âneverâ, âfullyâ, âunderstandâ]
-
What is serialisation and what is a use case of serialisation of data?
Serialisation means converting data stored in computer memory into a flat description of what the data means as displayed. -
What is JSON?
It 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. -
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, but with a few restrictions.
- 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.
- Comments are not allowed in JSON.
1)The problem cannot be solved with variable types such as strings or integers is to store multiple values in single variable
2)Arrays can be used
3)Properties are expressions that access a property of some value
4)null and undefined
5)By using dot or square bracket
6)Methods are the properties which contain functions in it
7)Objects are the arbitrary collection of properties
8)Objects can store values of different data types together
9)Objects are created by using braces-inside it there are list of properties which are separated by commas and each property has a name followed by colon and value
10)Javascript objects are mutable i.e it can be modify after it created
SECOND PART
1)Because string variables are immutable
2)It helps the function to accept any number of arguments
4)Serialization means to convert the data into flat description and it is useful for saving data or for transferring it to another network
5)JSON (JavaScript Object Notation) is a popular serialization format which is used as a data storage and communication format on the web
6)In JSON all property names are written in double quotes and only simple data expressions are allowed i.e no function calls ,bindings or comments are allowed in it.
-
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 a data structure that can store multiple values in a single variable. -
What variable type can be used in order to solve the problem of storing multiple values?
Arrays -
What are properties in Javascript?
Characteristics of values, for example string.length or Math.max -
Which values do not have properties?
Null and undefined. -
How can we access properties in a value (two ways)?
By using dot: value.property or brackets: value[âpropertyâ] -
What are methods?
Properties that contain functions -
What are objects?
Values of the type object are arbitrary collections of properties -
What problem do objects solve that cannot be solved with other value types weâve learned so far (such as integer, string, array, boolean etc)?
It can store multiple values of different data type. -
How do you define an object?
Inside curly brackets, a list of properties separated by commas. Each property has a name followed by a colon and a value.
{x: 0, y: 0, z: 2}
{ work: âWent to workâ,
âtouched treeâ: âTouched a treeâ
} -
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:
-
Why canât you add new properties to a string variable?
Because they are immutable -
What are rest parameters?
The rest parameter is bound to an array containing all further arguments. -
What is serialisation and what is a use case of serialisation of data?
Serialization is the process of translating a data structure or object into a format that can be stored or transmitted and reconstructed later into an identical object. -
What is JSON?
A popular serialization format which stands for JavaScript Object Notation. -
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.
-
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?
-Needs multiple data stored, this is only capable of one. -
What variable type can be used in order to solve the problem of storing multiple values?
-Arrays and Objects. -
What are properties in Javascript?
-Properties is an expression that contains a value. -
Which values do not have properties?
-undefined and null. -
How can we access properties in a value (two ways)?
-value.x ⌠value[x] -
What are methods?
-Properties that contain functions. -
What are objects?
-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)?
-can store values of multiple types of strings, arrays, booleans, etc. -
How do you define an object?
- braces are used to define an object.
- What can you say about the mutability of Javascript objects?
- You can change its properties.
SECOND PART:
- Why canât you add new properties to a string variable?
- strings , booleans, and numbers are immutable.
-
What are rest parameters?
-accepting any number of arguments. -
(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?
-converts data into description of itself. Enables the use of JSON. -
What is JSON?
- Java Script Object Notation.
- What are the differences between JSON and the way programmers write objects in plain Javascript?
-JSON requires double quotes.
Q1: 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?
A1: A variable type is needed that can store multiple values and makes them easy to access
Q2: What variable type can be used in order to solve the problem of storing multiple values?
A2: Arrays
Q3: What are properties in Javascript?
A3: Properties are values representing associated characteristics of a JavaScript object
Q4: Which values do not have properties?
A4: ânullâ and âundefinedâ
Q5: How can we access properties in a value (two ways)?
A5: dot and square brackets e.g. value.x and value[x]
Q6: What are methods?
A6: Properties that contain functions
Q7: What are objects?
A7: Objects enable the grouping of values, including other objects, to build more complex structures
Q8: 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)?
A8: Objects can hold/store a collection of many different data types
Q9: How do you define an object?
A9: By using open and closing curly brackets wrapped around a collection of key/value pairs - e.g. theObject = {asleep: false, toDos = [âstudyâ, âexerciseâ, âeatâ, âdrinkâ, âbe merryâ]}
Q10: What can you say about the mutability of Javascript objects?
A:10: Object values can be modified and thus termed as mutable whereas number, string and boolean types are have immutable values - i.e. one that are not possible to change
Q11: Why canât you add new properties to a string variable?
A11: A string is a primitive data type (and not an object) and as such they are immutable so the addition of and beyond the set of built-in properties is not possible
Q12: What are rest parameters?
A12: Rest parameters enable the representation of any number of arguments as an array to a function
Q13: What is serialisation and what is a use case of serialisation of data?
A13: Serialisation is conversion of data stored in memory (tangles of memory addresses
to a description) into a flat description format
Q14: What is JSON?
A14: JSON stands for JavaScript Object Notation and is widely used as a (serialised) data for storage and a communication format on & across the Web
Q15: What are the differences between JSON and the way programmers write objects in plain Javascript?
A15: JSON;
-
a) requires all property names to be surrounded by double quotes
-
b) only allows simple data expressions
-
c) does not permit function calls, bindings, or anything that involves actual computation.
-
d) does not allow comments
- 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?
A variable type is needed that can store multiple values and is easily accessible. - What variable type can be used in order to solve the problem of storing multiple values?
Arrays - What are properties in Javascript?
-Define some characteristic about the values in an array structure.
-Expressions that access some property of a value. - Which values do not have properties?
null, undfines - How can we access properties in a value (two ways)?
using brackets or a dot method. - What are methods?
properties that hold function values - What are objects?
objects are data structures that are capable of containing arbitrary collection of properties.
These are created using braces to contain a list of key/value pairs seperated by a comma. - 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 store many different data types. - How do you define an object?
value being in a list containing braces. - What can you say about the mutability of Javascript objects?
The values objects contain can be changed.
SECOND PART:
- Why canât you add new properties to a string variable?
A string is not an object - What are rest parameters?
(âŚargument)
When the functions called, the rest parameter is bound to an array containing all further arguments - (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?
When an object/array is translated into a suitable format for transfer over a network/storage. - What is JSON?
Javascript object notation, a specialization format widely used for data storage/communication. - What are the differences between JSON and the way programmers write objects in plain Javascript?
-property names in double quotes
-only simple data expressions
-no comments
First part:
- the necessity for grouping values in order to create more complex data structures
- a binding in the form of an array
- properties describe attributes attached to a value, such as length.
- null and undefined
- a) with a dot
b) with square brackets - methods are properties that contain functions, such as .toUpperCase or push or pop
- arbitrary collections of properties separated by commas
- they can hold multiple properties that are unrelated to each other and can contain values
of any type (boolean, array,âŚ), while each property can exist also in other objects. - using braces as an expression and filling it with properties divided by comma
- js objects are mutable, what is a difference to the immutable data types such as strings, integers,⌠Js objectsâ values can be changed and have different content at different times.
Second part:
- a string is not an object and does not store properties. You can only use their built-in properties on them
- a rest parameter is a kind of placeholder that accepts an infinite amount of arguments. This might be useful in case we donât know how many arguments we will receive as input into a function etcâŚ
- skipped
- we speak of serialization when we convert an object into a stream of bytes (in the book: âinto a flat descriptionâ). We want to do that in case we want to store or transmit our object in order to be able to recreate it elsewhere.
- I know JSON-LD as structured data loved by search engines to enrich search results. Never I have been aware of other use cases before
Turning back to the question: JSON (JavaScript Object Notation) is a serialization format often used for our data storage purpose. It is not limited to the use with JavaScript but compatible also with other languages.
- In JSON all property names have to be surrounded by double quotes (")
- limited to simple data expressions, excluding function calls, bindings etc
-
This Chapter introduces the ability to record and manipulate information that goes beyond simple strings and integers. It allows us to solve more complex problems involving actions and events.
-
Objects can store multiple values, arrays are a type of object.
-
a Property is an aspect of a Value such as color or length and can be called using a Dot such as value.property or [] such as value[property]
-
Null and Undefined do not have properties.
-
Two ways to access properties are with a Dot or a Bracket
-
Methods are properties that also contain functions such as .toUpperCase
-
Values of the type object are arbitrary collections of properties. One way to create an object is by using braces as an expression. The book uses an Octopus with tentacles to illustrate the concept of an object.
-
Objects allow us to store a list of activities and a Boolean value that indicates whether an event happened or not such as turning into the squirrel. It will allow us group values together into a single value and then put those grouped values into an array of log entries.
-
Objects are defined using curly bracket or brackets
-
Javascript objects are mutable, meaning you can change their properties, causing a single object value to have different content at different times.
SECOND PART
-
New parameters arent able to be added. 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.
-
Rest Parameters accept any number of arguments. Rest parameter is bound to an array containing all further arguments. If there are other parameters before it, their values arenât part of that array.
-
Serialization is the process of converting memory addresses into flat descriptions for ease of data storage and sharing.
-
JSON is a popular serialization format
-
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.
Part 1.
- Strings and Intergers are characters and cannot add value. What is required is an array to store the values of the characters or objects.
- An array can be used to solve the problem of using multiple values.
- Properties are characteristics defined within an object.
- The only values within Javascript which do not have properties are Null & Undefined.
- You can do this by using the dot. or square bracket[]
- Methods are properties which hold function values which will only work on the value ink which they belong to.
7 . An object is something which stores values which make up the object. - Because they can store multiple datatypes.
- By using braces and properties inside are each seperated by commas.
- It allows the characteristics of a data type to be changed or modified even after it has been declared.
Part 2. - Because a string is not an object and therefore does not have the ability to store new properties.
- The rest parameter is connected to an array which then contains all further arguments.
- Ok
- Serialisation is a process which takes information of a certain type and then shares it with other programs or devices.
- JSOC stands for Javascript Object Notation which is widely used for data storage and communication.
- You can only use simple expressions in JSON.
-
Jacques problem requires a daily log of everything he does and he needs a data structure to store this information. A data structure cannot be solved by strings or integers because it can only be attached to a single value.
-
We can use an Array which is similar to a variable but it can store multiple values and uses square brackets â[ ]â.
-
Properties are expressions built-in in JS to access a certain property (length, index, max or min function) of a specific value
-
The value ânullâ and âundefinedâ do not have properties.
-
Properties can be accessed in two ways: Using a dot â.â or using braces â[ ]â, these have differences in functionality.
-
Methods are properties that contain functions. These are unique functions to the values they belong to. An example is âtoUpperCaseâ which makes the word written in all caps, is a method of a string-value.
-
Objects contain an arbitrary collection of properties. One way of creating an object is by using braces as an expression.
-
Problems that involved the need of multiple data structures can be solved by objects because they can grasp multiple values and they can also have objects within objects which allows for a complex data structure.
-
Braces are used to define objects. If a brace is placed at the start of a statement it creates a block of statements, but if placed anywhere else it describes an object.
-
Objects can be modified which makes them mutable. You can change their properties that causes a single value to have different contents at different times. Objects are mutable unlike numbers, strings and booleans.
- 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?
In this real world example, (well, kind of), Jacques is required to collect more complex data. For example, he may want to combine data points, such as oak trees within an area, which he may suspect of triggering his transformations. Storing and analysing this data requires more complex data structures than integers and variables which only hold a single value.
- What variable type can be used in order to solve the problem of storing multiple values?
An array.
- What are properties in Javascript?
A feature/characteristic of a value, whether that be the length of its digit (example for strings) or its numeric value compared to other numeric values (example for integers).
- Which values do not have properties?
Null and undefined.
- How can we access properties in a value (two ways)?
Properties can be accessed with a dot . and with square brackets []. These are slightly different, in that the use of a dot yields the exact name of the property (array.length), while square brackets evaluate their content to generate a string used as the property name (value[x]).
- What are methods?
Methods are properties containing functions that relate to a value. Example of methods to arrays include .push (add a value to the end of an array) and .pop (remove the last value in an array and print it to the console).
- What are objects?
Data structures containing arbitrary collections of properties. Multiple and various types of values can be stored in an object (strings, integers, booleans, arrays).
- 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 store a collection of data i.e. hold multiple and different types of values and properties, and can assign values to properties, therefore storing more complex relationships between data.
â Objects hold many different types of data (arrays, integers, strings, booleans).
- How do you define an object?
Objects are defined like a variable, but also require the opening of braces which may contain a list of named properties, to which another list of (or single) values can been assigned.
- What can you say about the mutability of Javascript objects?
Unlike strings, integers and booleans, objects are mutable. An objects properties can be changed, meaning it is possible for the same objects to hold different values at different times. Moreover, referencing the same object in two instances is not the same as having two objects with the same properties.
Strings and their properties
- Why canât you add new properties to a string variable?
As strings are immutable, just like booleans and integers â they are not objects.
- What are rest parameters?
Rest parameters are useful for functions accepting numerous arguments. Calling such a function binds the rest parameter to an array. Rest parameters are written with three dots before the last parameter of a function (âŚnumbers).
-
What is serialisation and what is a use case of serialisation of data?
The conversion of data into flat a description. This allows one to save data in a file and send it to another recipient over a network, without having to send over the entire computerâs memory. -
What is JSON?
JavaScript Object Notation (JSON), is a popular serialisation format. It is also used as a data storage and communication format outside of JavaScript.
- What are the differences between JSON and the way programmers write objects in plain Javascript?
JSON is more restrictive:
- Property names must be denoted in double quotes
- Only simple data expressions are acceptable
- No computation is allowed, such as function calls or bindings
- Comments are not allowed