Hello sir, excellent answers , just one little thing, did you forgot to type answer of the 8 question?
Any doubt you have please let us know, we are here to help you!.
Carlos Z.
Hello sir, excellent answers , just one little thing, did you forgot to type answer of the 8 question?
Any doubt you have please let us know, we are here to help you!.
Carlos Z.
***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. Variables such as strings and integers can only store a single type of data.
***What variable type can be used in order to solve the problem of storing multiple values?
A. You would need to use arrays and written as a list of values between square brackets and separated by commas.
***What are properties in Javascript?
A. Properties are expressions that access a property of some value. Almost all JavaScript values have properties.
***Which values do not have properties?
A. The exceptions are Null and undefined.
***How can we access properties in a value (two ways)?
A. The two ways to access properties in JavaScript are with a dot and square brackets.
***What are methods?
Properties that contain functions are generally called methods of the value they belong to.
***What are objects?
A. 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)?
A. Objects have values that are mutable or changeable. Integers, strings, arrays and Booleans are immuntable.
***How do you define an object?
A. An object is a standalone entity, with properties and type which define their characteristics.
***What can you say about the mutability of Javascript objects?
A. Objects values can be modified. You can change their properties causing a single objects value to have different content at different times.
Think about the following questions:
***Why canât you add new properties to a string variable?
A. The values of type strings are immutable.
***What are rest parameters?
A. A rest parameter allows us to add any number of arguments as an array of a function. The rest parameter must be at the end of the array.
***What is serialisation and what is a use case of serialisation of data?
A. In computing, serialisation is the process of translating data structures or object state into a format that can be stored or transmitted and reconstructed later. It can be used to create a semantically identical clone of the original object.
***What is JSON?
A. JSON is a language-independent data format. JSON is a lightweight format for storing and transporting data.
***What are the differences between JSON and the way programmers write objects in plain Javascript?
A. All property names need to be surrounded in double quotes and only simple data expressions are allowed. No function calls, bindings or anything that involves computation. Comments are not allowed in Json.
1.) The ability to have a list of object stored as a sequence of values that can be altered like a journal and for each value to have itâs own properties.
2.) Arrays
3.) Attributes of a value.
4.) All values expect Null and Undefined
5.) Either by . or square brackets IE someVar.length someVar[x]
6.) properties that hold function values.
7.) An arbitrary collection of values.
8.) Objects unlike any of the aforementioned are mutable which means that itâs value can be modified.
9.) To me objects are like entries into a database.
10.) Json does not compute so no functions or bindings and values are wrapped in ââ.
Hi thecil,
Thanks for noticing, I think I overlooked that question. I would say that objects allow a collection of properties or data structures to be bundled into a single data structure (the object) making it easier to process/keep together.
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 doesnt allow flow of data gathering that well.
What variable type can be used in order to solve the problem of storing multiple values?
Array
What are properties in Javascript?
Properties for JS are the expressions that can access property values
Which values do not have properties?
Undefined/Null
How can we access properties in a value (two ways)?
Dot or Square brackets:
Brackets obtain properties by evaluating expressions
Dots obtain properties by the name being classified directly
What are methods?
Methods are properties that hold the function of a specific value
What are objects?
Object can be a variable, a data structure, a function, or a method, and as such, is a value in memory referenced by an identifier
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)?
Allows their values to be modified
How do you define an object?
var objectName = {
property1: value1,
property2: [arrayValue1, arrayValue2, arrayValue3]
};
What can you say about the mutability of Javascript objects?
That they are mutable
SECOND PART:
Why canât you add new properties to a string variable?
Strings have specific property values and cant be changed unless you change the function of the string
What are rest parameters?
Rest parameters lets you to set an indefinite amount of arguments in arrays
What is serialisation and what is a use case of serialisation of data?
serialsation converts specific types of data into a flat description that allows this new flat description to be saved for later or or send it to all memory addresses
What is JSON?
JSON is serialsation for data communication and storage.
What are the differences between JSON and the way programmers write objects in plain Javascript?
JSON needs " " for all property names. JSON doesnt allow actual computation so no function calls.
Strings and integers are separate, single type of data that cannot interact with each other in easy and organised way. Where we need to input chunks of different types of data that need to interact with each other and give the correct outputs.
Arrays can be used to store multiple values.
In Javascript properties are the characteristics of the object or value.
Null and undefined values does not have properties.
Two main ways to access properties in Javascript are with a dot and with square brackets.
Methods are properties that contain functions to the value they belong to.
Objects are arbitrary collections of properties of the value.
Objects can hold any data types together. Analogy: like octopus where each leg is a different type of data.
Defining object can be done by using braces as an expression.
Values in objects can be changed which means they are mutable, where other types of values like numbers, strings and booleans are immutable.
SECOND PART
String values are immutable.
Rest parameters can be used for a function to accept any number of arguments by writing three dots before the functionâs last parameter.
(Feel free to skip the sub-chapter of Math object and Destructing) - too late
Serialisation is data converting from computerâs memory addresses into a description that can be stored and sent. Serialisation of data is necessary to be able to save your code or send it over to another computer over the network.
JavaScript Object Notation aka JSON is widely used as a data storage and communication format on the Web.
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.
Storing different types of value in a string would not be possible because a string can only contain one value. If you would put numbers with spaces in a string and would later like to access the information of one of the numbers, youâd have to somehow take out the digit and convert it to a number again. That wouldnât be efficient enough.
Arrays. They are used for storing sequences of values.
Properties in Javascript are expressions that access the property of some value.
All values have properties except null and undefined.
by using a dot or square brackets e.g value.x
and value[]
Methods are properties that hold the function of a value.
Values of the type object can store as much information as possible.
With Objects, it is possible to change the values of an object at any time you want.
You can create objects by using braces as an expression.
let example = {
myExamples: true,
examples: ["example1", "example2", "example3"];
}
SECOND PART:
Because strings are immutable so they canât be changed but, they have build-in properties that are methods like e.g slice
and indexOf
.
Rest parameters are called when you use three dots before the functionâs last parameter. Rest parameters accept any number of arguments.
Serializing the data means that it is converted into a format that is suitable for transferring data over to a network or storage.
JSON is a popular serialization format that stands for JavaScript Object Notation. It is most of all used to store data, and as a communication format on the web.
The difference is that in JSON only double quotes can be used to surround property names. No function calls, bindings, computation, or comments are allowed in JSON. only simple data expressions are allowed.
First Part:
Second part:
1- Because âstrings are immutableâ.
2- An array
3- They allow us to access info about an expression.
4- Null, undefined
5- dot, [ ]
6- Properties that contain functions
7- Arbitrary collections of properties.
8- An object can contain different types of data
9- With a pair of [ ]
10- You can change their properties so they can have different content at different times
1- Because they are immutable
2- It allows us to represent an indefinite number of arguments as an array.
3-
4- Means data is converted into a flat description. Simplifies data storage and transfer
5- A system of data storage and communication on the web
6- In JSON 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 problem does this chapter introduce that cannot be solved with variable types such as strings or integers?
Need to adopt a scientific approach to collect store data in a data structure in order to narrow down the conditions that trigger the irregular occurrences of transformation.
2. What variable type can be used in order to solve the problem of storing multiple values?
An array is a data type specifically for storing sequences of values.
3. What are properties in Javascript?
A property of some value is accessed through an expression (ex. myString.length (to get the length of a string))
4. Which values do not have properties?
Null and undefined do not have properties, they are considered non-values.
5. How can we access properties in a value (two ways)?
The two main ways to access properties in JavaScript are with a dot and with square brackets. Ex. value .x and value[x]
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)?
9. How do you define 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?
Since object values can be modified, they are mutable. In comparison, types of values such as numbers, strings and Booleans are all immutable (impossible to change values of those types). Objects work differently, you can change their properties, causing a single object value to have different content at different times.
In sub-chapter called Strings and their properties
1. Why can't you add new properties to a string variable?
Values of type string, number, and Boolean are not objects, it does not actually store those properties. Such values are immutable and cannot be changed.
2. What are rest parameters?
The rest parameter is bound to an array containing all further arguments.
3. (Feel free to skip sub-chapter of Math object and Destructing)
4. What is serialisation and what is a use case of serialisation of data?
Serialize the data means to convert it into a flat description. It is widely used as a data storage and communication format on the Web.
5. What is JSON?
JSON is a popular serialization format which stands for JavaScript Object Notation.
6. What are the differences between JSON and the way programmers write objects in plain Javascript?
The difference is 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.
Think about the following questions:
Use an integer array.
These are attributes of a data type that allow us to better understand the data (ex. String has length, Math has min, max and avg )
Null and undefined.
value.x or value[x]
Methods are built-in functions that enable data to be manipulated (upper, lower)
Values of the type object are arbitrary collections of properties.
Ability to store a record of entries of common type vs. discrete forms of isolated data
Arrays are just a kind of object specialized for storing sequences of things.
Think about the following questions:
We canât extract the digits and convert them back to numbers to access them.
Rest parameter is bound to an array containing all further arguments
Serialization is converting all the data to a flat type that can be shared with other devices/systems (use case).
JSON stands for JavaScript Object Notation . It is a widely used as a data storage and communication format on the Web to share data.
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 ONE:
The problem of not being able to store multiple values of different types in variables that can only hold strings or integers.
Object variables and Arrays
Properties are name:value pairs in objects. Objects hold property values that are assigned to specific property names.
By dot notation or by squared brackets.
objectName.propertyName
or
objectName[âpropertyNameâ]
If we have a property name that is an integer or a string that contains a space, we must use squared brackets to access them.
Methods are actions that can be performed on objects. We can write and store functions in objects and apply them or we can use JavaScript built in functions such as toUpperCase().
Objects are variables that can store multiple amount and different types of data.
Objects can hold different types of data, that we can add to, update, delete or reference.
We use curly braces {}, and between them we use name-value pairs with colons between them. Each name : value pair is then separated by commas.
Objects in JavaScript are mutable, they can be deleted, added to and property values can be updated easily.
The ability to store multiple values of different types.
Array.
Properties are values that can be accessed by using the â.â operator. You can use them to get the length of a value or the maximum value of an array for example.
Non-values like null don´t have any properties.
By using the â.â operator or by wrapping the property inside brackets â[]â.
Methods are properties that contain functions.
An object stores a collection of properties.
They can grasp and let go of as many different values and datatypes as we need them to.
let objectName = {
properties inside object
};
The property values inside of the same object can be changed at will later inside the same program, which is not possible with
values of the type integer, string and boolean.
SECOND PART
String values are immutable and can only access the properties that have been programmed into them by the programming language.
You can use the rest parameter to accept any number of arguments inside a function. Use the rest parameter by writing three dots in front of the last parameter inside a function.
Serialization is used to convert the state of a program or file for saving purposes or to send it.
JSON is a broadly used serialization format used on the web.
In JSON, property names must be surrounded by double quotes. Everything that involves computation is not allowed. It is like a captured moment, a photograph.
- 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?
- What are properties in Javascript?
- Which values do not have properties?
- How can we access properties in a value (two ways)?
- What are methods?
- What are objects?
- 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)?
- How do you define an object?
- What can you say about the mutability of Javascript objects?
SECOND PART:
- Why canât you add new properties to a string variable?
- What are rest parameters?
- What is serialisation and what is a use case of serialisation of data?
- What is JSON?
- What are the differences between JSON and the way programmers write objects in plain Javascript?
He want so have a set of data that he could track, and this is not possible by using single variables.
An array could be used to store multiple values which is what he needs.
A JavaScript property is a characteristic of an object, often describing attributes associated with a data structure.
There are two kinds of properties:
The JavaScript exception ânull (or undefined) has no propertiesâ occurs when you attempt to access properties of null
and undefined
. They donât have any.
Thereâs two ways to access properties: objectName.propertyName
or objectName["propertyName"]
A method is a function which is a property of an object.
There are two kind of methods:
Instance Methods which are built-in tasks performed by an object instance, or Static Methods which are tasks that are called directly on an object constructor.
The Object class represents one of JavaScriptâs data types. It is used to store various keyed collections and more complex entities. Objects can be created using the Object() constructor or the object initializer / literal syntax.
They collect multiple values of different types, it could also be other objects. Just think about a person, a person has a name, which is a string, but also an age(number), height, weight, etc. Could also have parents of the same object. By defining a object you can collect all information thatâs necessary in one value.
Objects are variables too. But objects can contain many values.
This code assigns many values (Honda, Accord, white) to a variable named car:
var car = { type: "Honda", model: "Accord", color: "white"};
The values are written as name:value pairs (name and value separated by a colon).
A mutable object is an object whose state can be modified after it is created. An immutable object is an object whose state cannot be modified after it is created.
Examples of native JavaScript values that are immutable are numbers and strings.
Examples of native JavaScript values that are mutable include objects, arrays, functions, classes, sets, and maps.
They are immutable and canât be changed.
The rest parameter syntax allows us to represent an indefinite number of arguments as an array.
The process whereby an object or data structure is translated into a format suitable for transferral over a network, or storage (e.g. in an array buffer or file format).
In JavaScript, for example, you can serialize an object to a JSON string by calling the function JSON.stringify().
JSON is a syntax for serializing objects, arrays, numbers, strings, booleans, and null
. It is based upon JavaScript syntax but is distinct from it: some JavaScript is not JSON.
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.
It requires storing multiple pieces of information together. While this could be done using strings, parsing strings is more trouble than itâs worth.
(on a side note I worked on a C# project where a novice programmer had decided to encode related data into the names of checkboxes in the User Interface (UI)!
Array or Object
A name-value pair associated with an object
The values null
and undefined
.
foo.bar
myArray[1]
person["first name"]
Values that are functions.
A collection of properties.
Problems that require relational data.
A comma separated list of name-value pairs, wrapped in curly braces. Name value pairs are separated with colons (:
). I.e:
let person = {
name: "Bob",
age: 40
}
Mutability means the property values of an object can change. On a more fundamental level this effects how equality is evaluated.
SECOND PART:
Because strings are not objects and are immutable.
A special parameter which represents any additional supplied parameters as an array (the ârestâ of the parameters). The rest param must be the last parameter listed and is prefixed with ...
.
The process of converting data into a format more suitable for sending or storing somewhere- i.e. for sending in an http request.
Java Script Object Notation
Data Structures (Arrays and Objects) - Reading Assignment:
let object2 = {value: 11};
Now youâve probably come to the sub-chapter called The lycanthropeâs log. Skip this chapter if you want as it for some reason introduces a lot of math which is completely unnecessary at this point.So feel free to jump to the sub-chapter called Strings and their properties .
Think about the following 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? Variable types such as strings and integers are only able to hold a single type of data. What Jaques needs is a data structure that is capable of storing multiple values so that he can keep all of the information he collects organized.
2. What variable type can be used in order to solve the problem of storing multiple values? An array is a data type that can be used to store a sequence of values.
3. What are properties in Javascript? A property is the association between an object key and its value, similar to how a variable is the association between a name and a value.
4. Which values do not have properties? Almost all JavaScript values have properties. The exceptions are null and undefined.
5. How can we access properties in a value (two ways)? The two main ways to access properties in JavaScript are with a dot and with square brackets. Both value.x and value[x] access a property on value.
6. What are methods? JavaScript methods are actions that can be performed on objects.
7. What are objects? JavaScript objects are containers for named values called properties and methods.
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? A JavaScript object is designed using an object literal:
var person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};
10. What can you say about the mutability of Javascript objects? The mutability of Javascript objects means that the values they contain can be changed. This is different from the other data types such as strings, numbers, and Booleans, which are all immutable.
1. Why canât you add new properties to a string variable? A string is not an object but a primitive data type. Therefore, it is immutable.
2. What are rest parameters? Rest parameters are an improved way to handle function parameters, because they allow users to represent an indefinite number of arguments as an array.
3. What is serialisation and what is a use case of serialisation of data? Object serialization is the process of converting an objectâs state to a string from which it can later be restored. Serialization can be used to translate an object state into bytes so that it can be sent over a network or stored on a hard drive.
4. What is JSON? JSON stands for JavaScript Object Notation. It is a lightweight format for storing and transporting data and is often used when data is sent from a server to a web page.
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?
Storing multiple values and datatypes are required to organise information properly, when variables are able to hold only single type of data like strings or integers
What variable type can be used in order to solve the problem of storing multiple values?
Arrays
What are properties in Javascript?
Characteristics of the values
Which values do not have properties?
Null and undefined
How can we access properties in a value (two ways)?
with a dot and binding name âarray.lengthâ or square brackets with an expression array[âlengthâ]
What are methods?
Methods are properties that contain function values and work only on the value
they belong to
What are objects?
Objects are data structures that contain 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 as many different datatypes as needed
How do you define an object?
Braces are used to create objects. Properties inside the braces are separated by commas. Each property is named, follow by a colon and a value.
What can you say about the mutability of Javascript objects?
Mutability of JS objects means that properties they contain might be changed
Why canât you add new properties to a string variable?
Because it is immutable, but it has built in properties like slice or indexOf
What are rest parameters?
Rest parameters allow functions to allow 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?
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.
What is JSON?
JavaScript Object Notation is a serialisation format widely used for data storage and communication on the Web
What are the differences between JSON and the way programmers write objects in plain Javascript?
JSON only allow simple values expression like strings, numbers, arrays and booleans. So no function calls, bindings, or anything that involves actual computation. Property names should be surrounded in double quotes and no comments are allowed.
FIRST PART
SECOND PART: