Hi Jon, appreciate you commenting on this and value your observations. What you say makes sense to me. It has been a while since I last used Javascript and I tend to like simplicity. From that perspective I suppose I would tend to use arrays if I needed use indexed values to iterate through simple lists and objects if I need to work with more complex datasets. I have to confess that I didn’t pick-up on the use of differing data types in the same array. Every day is a school day. Thanks.
Hi Mike,
It’s also good for me to hear about how someone (who, judging from your profile, already has a lot of practical experience as a developer/project manager) would actually use arrays and objects in real-world projects. My knowledge is still mainly theoretical, as I’m studying this with a view to finding work in this field — hopefully, in the not too distant future
I think you are absolutely correct in your more advanced definition.
You are allowed to do a lot of weird and confusing stuff in Javascript, like putting different types of objects and variables inside an array. I would not recommend doing it, unless you have a very specific use case. It would be very confusing for a new dev reading your code to understand exactly what’s going on with an array like that.
But from a definition stand point that absolutely right.
Part 1
1. To solve weresquirrel, data structures are needed that can hold multiple values and types to hold all the information. 2. One data structure that can hold multiple values is arrays. 3. Properties in Javascript are attributes for variables that provide needed information to provide appropriate solutions. 4. Null and undefined values do not have properties. 5. Properties for values are expressed by using dots (e.g. *property.attribute*) and by using brackets (*property*[*attribute*]). 6. JavaScript methods are actions that can be performed on objects. 7. Objects are fundamental blocks of JavaScript. An object is a collection of properties. A property is an association between a key (or name) and a value. Almost all objects in JavaScript are instances of the prototype defined. 8. Objects combined different properties to define a single condition as required to represent the specific situation. 9. An object is a collection of properties, and a property is an association between a name (or key) and a value. For example, let myObject = { name : "Joe Coder", location : "*Cyberspace*" } 10. Numbers, strings and Booleans are immutable values, but objects can have their properties changed. A specific value can have a different value at different points in time.Part 2
1. Values for types strings, numbers, and Booleans are not objects and have their own built in properties. Therefore Javascript will not store new properties for these types. 2. REST parameters are an improved way to handle function parameters, allowing easier handling of various input as parameters in a function. The REST parameter syntax allows us to represent an indefinite number of arguments as an array. 4. Serialization converts data into a format that can be stored. It uses JSON notation to convert data between data types, from string to the value it holds and vice versa. 5. JSON is JavaScript Object Notation, which is a serialisation format used for data storage and communication on the web. 6. All property names need to be surrounded in double quotes. Only simple data expressions are allowed. No function calls, bindings, comments, or anything that involves actual computation are allowed.- The information which is required to solve the problem needs a more complex shape than simple variables because it has multiple values.
- A data structure.
- Properties in javascript are the values which correspond to a javascript object.
- There are two values that do not have properties in javascript, null and undefined.
- We access properties in a value with two main ways, with a dot and with square brackets.
- Methods are actions that can be performed on objects, so properties that contain functions are methods.
- Objects are an arbitrary collection of properties, essentially they are variables that contain different types of values, or a collection of them.
- Objects can change their properties, where as other values like strings can’t.
- You can define an object by creating a variable literal e.g. book using braces and a list of properties separated by a comma. For example:
var book={
title:” Eloquent JavaScript”,
subtitle:”A Modern Introduction to Programming”,
author:” Marijn Haverbeke”
}; - Javascript objects are mutable, you can change their properties at any time so that they can have different content at different times.
SECOND PART: - String variables are immutable, you cannot add new properties to them because they not javascript objects.
- Rest parameters allow functions that allows any number of parameters. The rest parameters can be included in any function by using three dots … followed by the name of the array that contains them. If there are other parameters which are not rest parameters, the rest parameter must be at the end of the list of parameters.
- Serialisation of data is the process of converting structured data to a format that permits the sharing or storage of the data in a way that allows recovery of its original structure. It concerts the storage of such data to a flat description. A use case of the serialization of data is a data structure that contains an array within an array.
- JSON is a popular serialization (JavaScript Object Notation). It has been accepted as a standard for data storage and communication format on the Web.
- JSON is formatted in a way that is similar to writing data objects in javascript with a few differences:
a) property names have to be surrounded by double quotes
b) only simple data expressions are allowed—no function calls, bindings, or anything that involves actual computation.
c) 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? In our daily log we need to store multiple values within a single variable which cannot be accomplished with a string or integer.
- What variable type can be used in order to solve the problem of storing multiple values? We can use an array variable type to store multiple values.
- What are properties in Javascript? Every values excluding null and undefined have properties which give us additional information we can derive from a given value.
- Which values do not have properties? Null and undefined have no properties.
- How can we access properties in a value (two ways)? We can access properties on a value with a dot or square brackets: value.x or value[x].
- What are methods? Methods are properties that contain functions.
- What are objects? Objects 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)? We are able to group an array of daily activities and a Boolean value of whether he turned into a squirrel into one value the day number and store those values within an array the daily log.
- How do you define an object? Objects are defined by using braces as an expression.
let object = {
Property1: value,
property2: [“string0”, “string1”, “string2”, “string3”]
};
-
What can you say about the mutability of Javascript objects? The properties of an object can be changed so that a single object value has different content at different times.
-
Why can’t you add new properties to a string variable? A string variable is immutable, therefore the properties cannot be changed.
-
What are rest parameters? Within a function that accepts any number of arguments the rest parameter is an array of 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? Data is serialized by being converted to a flat description. This allows data to be stored or sent over the network.
-
What is JSON? JSON stands for JavaScript Object Notation and it is a popular serialization format.
-
What are the differences between JSON and the way programmers write objects in plain Javascript? All property names need to be surrounded by double quotes, no comments are allowed, and no function calls, bindings or actual computations 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?
To save several values and data on one varuable.
2.What variable type can be used in order to solve the problem of storing multiple values?
We can use Arrays.
3.What are properties in Javascript?
They are Characteristics.
4.Which values do not have properties?
Null value, undefiend
5.How can we access properties in a value (two ways)?
With index[x] and value.x
6.What are methods?
Properties that contain functions.
7.What are objects?
Objects hold 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 on one object.
9.How do you define an object?
var obj ={
reading: false,
activities:[“Party”, “Swimming”,“Drinking”]};
10.What can you say about the mutability of Javascript objects?
We can change properties.
11.Why can’t you add new properties to a string variable?
Because they are immutable.
12.What are rest parameters?
Parameters that a function takes and put into an array.
- OK
14.What is serialisation and what is a use case of serialisation of data?
Converting into a flat description.
15.What is JSON?
It is a serialization forma.
16.What are the differences between JSON and the way programmers write objects in plain Javascript?
In JSON we can put only data and names, while in JS we can make complex computing operations.
- We needed to store many values in one structure.
- You could use an array.
- They are extra information about a certain thing like a string or object.
- Null and undefined do not have properties.
- You can access properties with either . or [] such as value.x or value[x].
- Methods are properties that contain functions.
- Objects are collections of properties.
- You can store many types of information in an object.
- You define an object with { } and inside the key value pairs are separated with key: value,
- You can change the information that the variables refer to as well as the bindings.
Part 2
- You can’t add because they are not objects. Only objects are mutable.
- It’s when you use … and the input name to show all possible inputs must be taken.
- It’s converting data to flat description and is used for data storage.
- JSON stands for JavaScript Object Notation and is a type of serialisation of data.
- You must always use " " when you are writing property names and you cannot use anything that requires computation like functions.
Part 1 questions:
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? Its would be of an hazzle to convert them back to numbers and sperate them back.
2. What variable type can be used in order to solve the problem of storing multiple values? Arrays
3. What are properties in Javascript? They are like variables holding a value within an object. Their names are strings and work in key: value pairs
4. Which values do not have properties? Null and undefined.
5. How can we access properties in a value (two ways)? Using square brackets and quotes [“propertyName”].
Or
using .propertyName
6. What are methods? Methods are properties holding a function.
7. What are objects? Its a variable that contain a list of properties each holding a value. It is a data structure.
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)? Immutability. Data types and versatility since they have a mutable structure. (Had a hard time formulate my answer on this one.)
9. How do you define an object? An object is a virtual data container. Where the data is stored in Key/value pairs named Properties. Properties can be any data type like strings number boolean and arrays.
10. What can you say about the mutability of Javascript objects? That it makes them very practicals in many situation. But pretty complex to know every like aspect of object data structures.
Part 2 questions:
1. Why can’t you add new properties to a string variable? They are immutable
2. What are rest parameters? Its a way of giving an variable number of arguments to a function. The parameters trailing at the and get stored in an array and iterated in the function.
3. What is serialisation and what is a use case of serialisation of data?
4. What is JSON? JavaScript Object Notation, its Is a data structure to record and share information.
5. What are the differences between JSON and the way programmers write objects in plain Javascript? Property names as written as strings, it is mandatory.
- 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 daily log requires multiple data types to be stored. Strings or integers use single data types. If we stored all our data in numerous string and integer variables, we would need some very complex programming to merge the data and extract relevant information.
- What variable type can be used in order to solve the problem of storing multiple values?
Arrays
- What are properties in Javascript?
Properties are the characteristic or attribute of a variable.
- Which values do not have properties?
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)?
We can access properties in a value with a dot, or square brackets (eg value.x or value[x]).
- What are methods?
Methods are actions or functions that can be performed on values or objects. They can be used to manipulate arrays.
- What are objects?
Objects 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)?
You can store many types of information in an object and make it easy for the developer to group this data as well as access and adjust it.
- How do you define an object?
Let objectname = { }
- What can you say about the mutability of Javascript objects?
The mutability of objects and arrays means that values (or parts of) can be edited and adjusted. Primitive elements are immutable meaning they cannot be edited; however they can still be re-assigned.
Second Part
Think about the following questions:
- Why can’t you add new properties to a string variable?
Technically you can add new properties, but they are not stored and therefore cannot be returned. They are immutable.
- What are rest parameters?
The rest parameters gather all the remaining values in an array. It is a parameter written last in the code line preceded by three dots (…). It refers to the “rest of” (remaining) 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?
Objects and arrays are stored in the computer’s memory. If you want to save data in a file for later or send it to another computer over the network, you have to somehow convert these bits of memory addresses to a description that can be stored or sent. What we can do is serialize the data. That means it is converted into a flat description.
- What is JSON?
JSON stands for JavaScript Object Notation, and is an example of serialized data.
- 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. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
A:Objects allow us to group values—including other objects
2. What variable type can be used in order to solve the problem of storing multiple values?
A:To store sequences of data with arrays.
3. What are properties in Javascript?
A: A way to access a property of some value, as mystr.lenght.
4. Which values do not have properties?
A:null and undefined have none properties.
5. How can we access properties in a value (two ways)?
A: value.x and value[x], Where as 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.
But the dot notation works only with names that look like valid binding, as in doh.toUpperCase()
6. What are methods?
A:Properties that contain functions with a dot notation,are generally called methods of the value they belong to, as in
mystring.toUpperCase is a method of a string”.
7. What are objects?
A: Values of the type object are arbitrary collections of properties
8. What problem do objects solve that cannot be solved with other value types we've learned so far (such as integer, string, array, boolean etc)?
A: To group different values together into a single value, to easier group values into an array and to get out and in values in a structured way.
9. How do you define an object?
A: Braces have two meanings in JavaScript. At the start of a statement, they start a block of statements. In any other position, they describe an object. One way to create an object is by using braces as an expression.
10. What can you say about the mutability of Javascript objects?A:Numbers, strings, and Booleans, are all immutable, but Objects work differently. You can change their properties, causing a single object value to have different content at different times.
Strings and their properties part
1. Why can't you add new properties to a string variable?
A: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.
2. What are rest parameters?
A: To accept any number of arguments to a function, three-dot notation before the variable name. the rest parameter is bound to an array containing all further arguments.
3. (Feel free to skip the sub-chapter of Math object and Destructing)
4. What is serialisation and what is a use case of serialisation of data?
A:That means it is converted into a flat description. A popular serialization format is called JSON (pronounced “Jason”), which stands for JavaScript Object Notation. It is widely used as a data storage and communication format on the Web, even in languages other than JavaScript.
5. What is JSON?
A:JavaScript gives us the functions JSON.stringify and JSON.parse to convert data to and from this format
6. What are the differences between JSON and the way programmers write objects in plain Javascript?
A:JSON looks similar to JavaScript’s way of writing arrays and objects, with a few restrictions. All property names have to be surrounded by double quotes, and only simple data expressions are allowed—no function calls, bindings, or anything that involves actual computation. Comments are not allowed in JSON.
- Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
The lack of a data structure to store the information.
- What variable type can be used in order to solve the problem of storing multiple values?
Objects and arrays (which are a specific kind of object).
- What are properties in Javascript?
Properties are the values associated with a JavaScript object.
- Which values do not have properties?
null and undefined.
- How can we access properties in a value (two ways)?
valeu.x or value[x]
- What are methods?
Properties that contain functions.
- What are objects?
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)?
With objects, we can group several values into a single value.
- How do you define an object?
It could be seen as a big bag full of different things. So instead of having several bags and try to hold them at once, which is more difficult and complicated, we have only one thing to grab.
- What can you say about the mutability of Javascript objects?
Numbers, strings or Booleans are immutable, which means that it is impossible to change values of those types. Objects are different; they are mutable because it is possible to change their properties so that a single object value may have different content at different times.
SECOND PART:
- Why can’t you add new properties to a string variable?
Because it is an immutable type of value.
- What are rest parameters?
The rest parameter syntax allows us to represent an indefinite number of arguments as an array.
- (Feel free to skip the sub-chapter of Math object and Destructing)
Ok
- What is serialisation and what is a use case of serialisation of data?
To serialize the data is to convert the information of objects and arrays stored in the computer’s memory as sequences of bits holding the addresses of their contents into a flat description.
A use of case could be sending a file over the network.
- What is JSON?
JSON stands for JavaScript Object Notation and it is used as a data storage and communication format on the Web.
- What are the differences between JSON and the way programmers write objects in plain Javascript?
The property names of an object must be surrounded by double quotes and only simple expressions are 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?
Strings can have any length and store alot of data, but you would have to somehow extract the data and convert it back to numbers to access specific parts. - What variable type can be used in order to solve the problem of storing multiple values?
An array. - What are properties in Javascript?
A characteristic of a value. - Which values do not have properties?
Null and undefined. - How can we access properties in a value (two ways)?
with a dot and with square brackets. - What are methods?
Properties that contain functions, ex: toUpperCase is a method of a string. - What are objects?
A 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 store data within the a string or an array as a single value before creating an array of these values. - How do you define an object?
let hour13 = {
working: false,
activities: [“Eating”, “Youtube”, “Xbox”]}; - What can you say about the mutability of Javascript objects?
You can change an objects properties unlike a number or string or Boolean.
SECOND PART: - Why can’t you add new properties to a string variable?
Only objects are mutable. - What are rest parameters?
They gather remaining values in an array. - (Feel free to skip the sub-chapter of Math object and Destructing)
- What is serialisation and what is a use case of serialisation of data?
Data converted into a flat description to save data in a file for later. - What is JSON?
JavaScript Object Notation is a popular serialization format. - What are the differences between JSON and the way programmers write objects in plain Javascript?
They look similar except for 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 Strings and integers or others tape of variable are only able to hold a single type of data.
2 We can use Arrays to store multiple values.
3 Properties in JavaScript are expressions that access a property of some value.
4 null and undefined.
5 The two main ways to access properties in JavaScript are with a dot and with
square brackets.
6 Both string and array objects contain, in addition to the length property, a
number of properties that hold function values.
7 Values of the type object are arbitrary collections of properties.
8 A object can hold different datatypes.
9 e.g. “var Car = {color: “green”, size = 2}”
10 Objects can be modified.
Second Part:
1 Values of type string are not objects and immutable.
2 They represent an array with all arguments that will be included and are called by writing three dots before the functions name.
3 The process whereby an object or data structure is translated into a format suitable for transferal over a network, or storage.
4 Is the process whereby an object or data structure is translated into a format suitable for transfer over a network or storage” // “convert into a flat description.
5 Json is a popular serialization format. “It is widely used as a data storage and communication format on the Web”.
6 Properties should also be written inside double quotes. JSON only allow simple values expression like strings, numbers, arrays and Boolean. “So no function calls, bindings, or anything that involves actual computation.
Strings or int’s are not practical for Jacques. He builds a data structure and therefore needs types that store more information
Arrays and objects
Properties are used to further examine a value
null and undefined
with value.property or value[something]
Methods are properties that contain functions.
7,8 )
Objects are capable of storing multiple sets of data, like arrays, booleans etc.
let object = {something};
Values inside objects can be changed depending on the binding. But it is for example not possible to code the value of a string away so that it would change.
Because a string value is immutable and cannot be changed. Strings are not objects
Rest parameters are beeing used if you want your function to accept any number of arguments.
Converting data into a flat description is serialization. It is used to only collect and for example send the specific data you want instead of sending everything
JSON is a serialization format and stands for JavaScript Object Notation. It is a data storage and communication format, even in languages other than JS.
In JSON all property names have to be surrounded by double quotes, and only simple data expressions are allowed, not function calls, bindings, or anything that involves computation. Comments are also no allowed.
First Section
-
Variable types such as a string or an integers can only hold single data types. What we need is a data structure that can hold multiple types of data.
-
Arrays can be used store multiple values
-
Properties in JavaScript are characteristics about the value of the data, such as length.
-
Null and Undefined do not have any properties
-
We can access properties by using Dot “.” or Braces"[]" on a variable.
-
Methods are properties that hold function values
-
Objects are data structures that have the ability to store multiple data types and a collection of properties.
-
Object allow us to hold a verity of data types
-
An object is a variable that contains a verity of datatypes which can be referenced and changed as needed
-
Mutability in JavaScript objects mean that datatypes with in the object can be changed, added, or deleted.
Second Section
-
A string is a primitive and immutable
-
A rest parameter is used so a function can take on any number of arguments. It is denoted by dots before the function’s last parameter, this represents the array of arguments that will be passed to the function.
-
Serialization is converting that data stored in memory into a flat description to save the data as a file which can then be used later or sent to another machine.
-
JavaScript Object Notation is a serialization format widely used as a data storage and communication format on the Web and is compatible with multiple programming languages.
-
All property names have to be surrounded by double quotes,
and only simple data expressions are allowed—no function calls, bindings, or
anything that involves actual computation. Comments are not allowed in
JSON.
1. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
Storing a sequence of numbers in an array instead of a string removes the need of character-to-numeric conversion when accessing the 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?
A particular aspect of a value such as its length or maximum value.
4. Which values do not have properties?
null and undefined
5. How can we access properties in a value (two ways)?
With a dot (.) or square brackets ([]).
6. What are methods?
Properties that contain functions are generally called methods of the value they belong to.
7. What are objects?
Values of the type object are arbitrary collections of properties.
8. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
Values of different data types (such as integer, string, array, boolean, etc.) can be combined in one data structure.
9. How do you define an object?
One way to create an object is by using braces as an expression. Inside the braces, there is a list of properties separated by commas. Each property has a name followed by a colon and a value.
10. What can you say about the mutability of Javascript objects?
The properties of objects can be changed, causing a single object value to have different content at different times.
SECOND PART:
1. Why can’t you add new properties to a string variable?
Values of type string are immutable - it is impossible to change values of that type or add new properties to strings.
2. What are rest parameters?
A parameter that allows a function to except any number of arguments.
3. What is serialisation and what is a use case of serialisation of data?
Convert data into a flat description which allows sending it to another computer over a network.
4. What is JSON?
A popular serialization format is called JSON (pronounced “Jason”), which stands for JavaScript Object Notation. It is widely used as a data storage and communication format on the Web, even in languages other than JavaScript.
5. What are the differences between JSON and the way programmers write objects in plain Javascript?
JSON looks similar to JavaScript’s way of writing arrays and objects, with a few restrictions. All property names have to be surrounded by double quotes, and only simple data expressions are allowed—no function calls, bindings, or anything that involves actual computation. Comments are not allowed in JSON.
-
Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
that problem that this chapter introduces is the fact that variable types such as strings and integers are only able to hold a single type of data and to solve this multiple are needed. -
What variable type can be used in order to solve the problem of storing multiple values?
a variable type that can be used to sole this problem are arrays, they are capable of storing multiple values. -
What are properties in Javascript?
in javaScript properties are used to describe characteristic of a value. -
Which values do not have properties?
two properties that do not have value are Null and Undefined. -
How can we access properties in a value (two ways)?
value.x
value[x] -
What are methods?
a method is a property that has a function. -
What are objects?
object are values with a 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 be used to hold different data types. -
How do you define an object?
objects are defined by curly braces. -
What can you say about the mutability of Javascript objects?
it is impossible to change values of numbers strings booleans, but in objects you can change the properties.
object value can have different content at different times.
SECOND PART:
-
Why can’t you add new properties to a string variable?
you cant add new properties to a sting variable because sting variables are not objects. -
What are rest parameters?
rest parameters make us able to use any number of argyments as an array. -
What is serialisation and what is a use case of serialisation of data?
the process of changing data into a smaller flat description to save data is called serialism.
5.What is JSON?
JSON is javaScript object notation, a simple data expressions used to call a reference from data of a server.
- What are the differences between JSON and the way programmers write objects in plain Javascript? the differnce is no fuction calls, bindings or comments are allowed in JSON.
Hello,
-
The subchapter introduces the need for a variable that can hold a variety of values, and not a single one. Also, the defining cause of squirrel lycanthropy might be unknown.
-
An array might be used to store different values, and add new ones as squirrel lycanthropy is better researched.
-
Property are the defining features of a variable or array, such as the length of a string, or its position in an array.
-
null and undefined are the only two variables without properties.
-
Properties can be accessed with value.x or value[x]. The first one fetches the value directly, the second one evaluates the expression x. The second one must be put in quotation marks.
-
Methods are properties containing function values. In other words, functions present inside an object. For instance, an array can be modified using the array.push(x); method. Just for it being an array, it has this function available for use.
-
An object is a value with an arbitrary list of properties. They are created using square brackets. unless bound, these properties must be put in speech commas “”.
-
Objects allow for a variable to have multiple defining features, and not just only one.
-
var object = [ “feature1”, “feature2”, “feature 3”];
-
once you set a value for a variable, string, or boolean the value cannot change. With objects, the values within the brackets may change, and so does the object.
part 2
-
because it won’t change the former variable, it will create a completely new one with new features.
-
Rest parameters are used to include all the elements inside an array without having to quote them all. it is introduced by “…” . For example function max(…numbers){etc
} -
Serialization allows values as expressed in the code to be packaged into a flat description. It is useful for arrays.
-
JSON is a way to serialize data. It stands for JavaScript Object Notation. It allows for the tangle of data present in the code to be sent in a comfortable package to another computer, without having to send everything. MyEtherWallet used to employ JSON to store private keys.
-
JSON has restrictions as compared to Javascript. Comments are not allowed, neither are function calls, bindings or what requires computation. You can only write simple data expressions, and property names must be in double quotes.
Best