-
creating objects allows the grouping of relevant information. the journal data could have been stored in simple arrays, but then the activities would no longer be associated with the “squirrel?” boolean value.
-
objects and arrays
-
properties are the individual fiels of an object
-
scalars
-
with brackets or via numerical index
-
named functions bound to variables in an object
-
a conceptually related set of structs and methods
-
see #1
-
curly braces
-
JS objects are mutable. You can update and modify the structure and contents.
-
Strings are immutable, and are not objects.
-
REST parameter is a notation used to expand an array object into a flat list of arguments. myArray[0] and myArray[1] become str1, str2 for the input into a function
-
serialization of data is needed any time data needs to be written to a document or sent over the wire. API calls, Writing data to a file, writing data to a database, are all examples of data needing to be serialized.
-
JSON is a notional data format commonly used when serializing data or invoking APIs
-
They are very similar. JSON requires double quoting key values, and dues not support functions being assigned as values.
-
The problem of needing to store a varying amount of data, of potentially different types and lengths.
-
Objects
-
Properties are named attributes of an Object that can hold a value (or another object, or an array).
-
null and undefined do not have any properties.
-
You can use the . notation or the square bracket notation i.e. object.value or object[‘value’]
-
Methods are functions. Many objects have built-in methods. i.e. toString()
-
Objects in javascript are data structures for storing data of multiple values and types.
-
You can assign methods and properties to an object which you can’t do with the built-in data-types.
-
Using curly braces {}
-
A javascript object’s value can be updated but the object itself is immutable. It cannot be re-instantiated. There is ways to delete values from objects though.
-
I just had a play around in Developer Tools and it did let me add properties to a String variable. But I expect this isn’t mean’t to work.
-
Rest parameters is a way of defining a function without defining each argument individually. e.g. so it can accept 1 - n number of parameters, these can then be read in by the function. The … notation is used e.g. …theArgs
-
Thanks
I tried to understand it anyway.
-
Serialization is the process of preparing data for transmission over a network or to storage. For example you can serialize a javascript object into a json string by using JSON.stringify(jsonData).
-
Javascript Object Notation. It’s like XML but more efficient.
-
JSON requires quotes around all keys and values, javascript objects do not.
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 chapter introduces data structures that can be used to store specific information.
What variable type can be used in order to solve the problem of storing multiple values?
Objects
What are properties in Javascript?
Properties are expressions that can access a property of some value.
Which values do not have properties?
null and undefined
How can we access properties in a value (two ways)?
We can access properties are with a dot and with square brackets. Ex: value.x and 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)?
Objects can group together values and analyze the values against each other
How do you define an object?
Objects are arbitrary collections of properties
What can you say about the mutability of Javascript objects?
The objects of javascript properties can be changed, causing a single object value to have different content at different times.
Why can't you add new properties to a string variable?
A string value is immutable by definition and can not be changed.
What are rest parameters?
Rest parameters are bound to an array containing all further aguments. This is primarily useful when we want a function to accept any number of parameters.
(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?
Serialization is the process of converting data from a series of memory addresses into a flat description.
What is JSON?
JSON stands for Javascript Object Notation. It is widely used a data storage and communication format on the web.
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. All property names must be surrounded by double ques, and only simple data expressions are used. There are no function calls, binding, or anything involving actual computations. Comments are not allowed in JSON.
-
a way to store the collection of data in a structured format.
-
arrays
-
these are expressions that access a property of some value. almost all JavaScript values have properties.
-
"null"and “undefined”- will give an error message
-
the two main ways to access properties in JavaScript are with a dot and with square brackets.
-
properties that contain functions are generally called methods of the value they belong to
-
values of the type object are arbitrary collections of properties.
-
it is able to store multiple data types
-
by using square braces as an expression
-
objects are mutable. meaning that you can change their properties.
strings and their properties
-
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.
-
when such a function is called, 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.
-
-
It is widely used as a data storage and communication format on the Web, even in languages other than JavaScript. JSON looks similar to JavaScript’s way of writing arrays and objects, with a few restrictions.
-
JSON stands for the JavaScript Object Notation.
-
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
- What problems does this chapter introduce that cannot be solved with variable types such as strings or integers? The ability to extract data from a string or list of integers is not easy. Arrays offer a solution for data extraction.
- What variable type can be used in order to solve the problem of storing multiple values? Arrays solve the problem of storing multiple values.
- What are properties in Javascript? Properties describe the attributes of an array such as length, Math.max, color, etc.
- Which values do not have properties? Null and undefined do not have properties.
- How can we access properties in a value (two ways)? We can access properties by ".x " or by “[x]”.
- What are methods? Methods are properties that contain functions.
- What are objects? Objects are a collection of properties inside braces.
- What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)? Objects can contain multiple properties, function, etc. and one entity.
- How do you define an object? An object is defined by properties inside braces and separated by commas.
- What can you say about the mutability of Javascript objects? Javascript Objects are mutable … meaning that the properties inside the object can be changed at any time.
SECOND PART:
- Why can’t you add new properties to a string variable? Strings are “immutable” meaning that they can’t be change.
- What are rest parameters? Rest parameters are a series of there dots … used to call all arguments of 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? Serialization is a way to encode data so that it can be sent in a file.
- What is JSON? JSON is a storage and communication format.
- What are the differences between JSON and the way programmers write objects in plain Javascript? Properties are enclosed in double quotes, no comments are allowed and no calcuations are allowed in JSON format.
[/quote]
That he needs to log a data structure everyday capable to store multiple data in order to keep all the information in one place and organised.
Arrays its a variable type capable to store multiple values.
Properties are expressions that has access to some values such as length or max, etc.
Null and undefined.
By using a “dot” and a “square brackets”. After the dot, is the literal name of the property and the expression between the square brackets is evaluated to get the property name.
Objects such as string and arrays that contain a number of properties hold functions values.
Methods are properties that contain functions.
Obejcts are a group of values that are together into a single value. Inside an object there is a collection of properties each one with a name and values separated by commas.
Because objects can contain a group of datatypes as they need.
An object is a group of values put them into braces as an expression. Inside braces are a list of properties, each property has a name and a value of that name.
Mutability of javascript objects means that values can be modified, changed. Contrary to numbers, strings and booleans.
SECOND PART
Because strings can’t accept new properties. Are immutable so they can’t be modified.
It’s when a function accepts any number of parameters. You put three dots before the last parameter and when the function is called, the rest parameters is bound to an array containing all further arguments.
Serialisation is when we convert data stored in memory into a flat description of what data is. It’s very useful if we want to transfer data to another computer on a network.
Javascript object Notation is a popular serialization format that is used as a data storage on the web.
Properties names need to be surrounded in double quotes and only simple data expressions.
Part one:
-
Strings and integers are simple data types. If Jacques wants to store more information about each day he will need something more complex. A variable type is needed that can store multiple values and make them easily accessible.
-
Arrays offer a solution for storing multiple values
-
Properties in JavaScript are connections that have defined meaning within values.
-
Null and undefined are values that do not have properties.
-
We can access properties in a value with a dot .x or with brackets [ “x” }
-
Methods are properties that contain functions of the value they belong to.
-
Objects are types of values subject to collections of properties.
-
Objects can hold as many different datatypes as necessary, thus being more complex.
-
var candy = {color: “blue”, size = 20}
-
You can change objects properties, which can allow a single object value to have different content at different times.
Part two:
-
The properties of string variables are immutable and cannot be changed.
-
Rest Parameters represent an array with all arguments that will be included. They are called by writing three dots before the functions name.
-
Serialisation is conversion of data to a simple form which can be used to transfer data more seamlessly
-
JSON stands for JavaScript Object Notation which is a serialization format used frequently for data storage and communication on the web. It also works with other lanhguages.
-
Similar to JavaScripts way of writing arrays and objects. All property names have to be surrounded by double quotes, only simple data expressions allowed, and comments are not allowed.
-
A fragment of code that produces a value is called expression.
-
To catch and hold values , java script provides a thing called binding or variable.
3.the collection of bindings and there values that exist at a given time is called the environment.
4.a function is a piece of program wrapped in a value.
5.in a browser environment the binding prompt holder a function that shows a little dialog box asking for user input.
6.showing a dialog box or writing text to the screen is a side effect.
7.Objects are data structures that are capable of containing an arbitrary collection of properties. These are created using braces to contain a list key/value pairs separated by a comma.
8.control flow is the order in which the computer executes statements in scripts.
9.conditional execution control behavior in Javascript wether or not pieces of code can run.
10.the keyword “If” tells Javascript to start the conditional execution.
Second part
- The data type of string is not an object and does not allow for additional properties beyond that which is language based.
2.Rest parameters allows us to represent any number of arguments as an array.
4.Serialisation is the conversion of data into a flat description, which is useful for saving and sending data.
5.It is format popular for serialization.
6.Only simple expressions are allowed in JSON. There are no functions, bindings, comments, or computations.
Reading Assignment: Data Structures (Arrays and Objects).
Part I
-
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?
Turning into a squirrel without knowing any data of what is causing the transformation.
A data structure to store this information is needed, to solve the problem. -
What variable type can be used in order to solve the problem of storing multiple values?
It is called an array and is written as a list of values between square
brackets, separated by commas. -
What are properties in Javascript?
These are expressions that access a property of some value. -
Which values do not have properties?
It’snull
andundefined
. -
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.
When using a dot, the word after the dot is the literal name of the property (value.property
).
When using square brackets, the expression between the brackets is evaluated to get the property name (value[property]
). -
What are methods?
Properties that contain functions are generally called methods of the value they belong to. -
What are objects?
An array that has put data into grouped values.
Values of the type object are arbitrary collections of properties, that are listed inside braces, separated by commas.
Each property has a name followed by a colon and a 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)?
You can change their properties, causing a single object value to have different content at different times. -
How do you define an object?
A data structure, where you can store lists of arrays, where you can collect different types of data, in from of strings, integers and booleans. -
What can you say about the mutability of Javascript objects?
It can be modified compared to string, integers and booleans, who are immutable. It’s impossible to change values of those types.
With objects, there is a difference between having two references to the same object and having two different objects that contain the same properties.
Part II
-
Why can’t you add new properties to a string variable?
Such values are immutable and cannot be changed, where it
doesn’t actually store those properties. -
What are rest parameters?
It can be useful for a function to accept any number of arguments. -
What is serialisation and what is a use case of serialisation of data?
That means it is converted into a
flat description. -
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. -
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. Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
The problem introduces sequences of values. We need to be able to use a data type specifically for that, and it’s called Arrays. We also need to use Objects in order to be able to group values.
2. What variable type can be used in order to solve the problem of storing multiple values?
Arrays.
3.What are properties in JavaScript?
Properties hold function values. They access a value. Property names are strings.
4. Which values do not have properties?
Null and Undefined.
5. How can we access properties in a value (two ways)?
Properties are accessed using value.prop or value[“prop].
The two main ways are with a dot and with square brackets.
Ex: value.x and value[ x ]
When using the dot, the word after the dot is the name of the property. When using square brackets, the expression between the brackets is evaluated to get the property name.
6. What are methods?
Methods are functions that live in properties and (usually) act out on the value they are a property of. Properties that contain functions are generally called methods of the value they belong to, as in “toUpperCase is a method of a string”.
JavaScript methods are actions that can be performed on objects.
A JavaScript method is a property containing a function definition .
Methods are functions stored as object properties.
You access an object method with the following syntax: objectName.methodName()
What are objects?
Objects are random collection of properties. They provide ways to group several values into a single value. JavaScript objects are containers for named values called properties or methods.
I can access object properties in two different ways: objectName.propertyName or objectName[“propertyName”]
”In JavaScript, objects are king. If you understand objects, you understand JavaScript.”
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 are able to group several values into a single value. P.s. Arrays are just a kind of object specialized for storing sequences of things.
9. How do you define an object?
JavaScript objects are containers for named values called properties or methods.
A JavaScript object is a collection of named values.
10. What can you say about the mutability of JavaScript objects?
Unlike numbers, strings and Booleans, which are primitive data types, Object values can be modified. They are variables. We can change their properties, causing a single object value to have different content at different times.
Objects are mutable: They are addressed by reference, not by value.
1. Why can’t you add new properties to a string variable?
Because strings are not objects, and although the JavaScript allows me to set new properties on them, it won’t actually store those properties. However, strings have built-in properties. Examples: slice, indexOf, trim, padStart, split, join, repeat, length.
2. What are rest parameters?
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions (functions which accepts a variable number of arguments) in JavaScript.
A function definition’s last parameter can be prefixed with “…” and can have only one rest parameter after the three dots, but more in the front of it. The rest parameter must be the last parameter in the function definition.
4. What is serialization and what is a use case of serialization of data?
It’s the act of converting memory addresses to a description that can be saved, shared and stored. ” Serialization is the process of converting object state into a format that can be transmitted or stored”.
5. What is JSON?
JSON, pronounced “Jason” (JavaScript Object Notation) is a popular serialization format.
It is a lightweight data-interchange format. It’s used as a data storage and communication format on the Web.
6. What are the differences between JSON and the way programmers write objects in plain JavaScript?
In JSON all property names have to be surrounded by double quotes and only simple data expressions are allowed – no function calls, bindings or anything that involves actual computation. Comments are not allowed.
- This chapter can solve problems that require an organized data structure that can be read for the purposes of creating meaningful computations.
- An array can store multiple values.
- Properties are attributes of different values and variables.
- Null and undefined have no properties
- We can access properties through the dot and square brackets.
- Methods are properties that contain functions.
- Objects are collections of properties.
- Objects allow us to create and look at collections of data structured in specific ways so we can extract meaning that wouldn’t be possible otherwise.
- An object is a certain structured collection of properties.
- Objects are mutable.
- The properties of a string variable are fixed, so you can’t add new ones.
- Rest parameters allow a function to accept any number of arguments.
- Serialization of data is the capturing of object data in a standard way that can be portable. If I wanted to send the contents of an object to a co-worker, I would need to serialize it first.
- JSON is a popular way of serializing data.
- JSON represents objects in plain text whereas the way objects are stored in Javascript are as sequences of bits and their respective addresses.
- the problem was that he nedeed to create the database to store information about his actions. While is quite possible to do with strings, its hard to work with the diferren pieces of that data and analyze them. But its easy and comfortable to do that waith arrays.
- array
- properties are storing object’s elements.
- null and undefined
- The two main ways to access properties in JavaScript are with a dot and with square brackets.
- methods are properties that hold function values
- object are collections of properties.
- ojects let us store as a siggle valuse not just a lists of strings or numbers, but we can have a groups of values insige the object including also a boleean
- as a collection of properties
- mutability is the ability to change properties of oblects.
SECOND PART: - because string is not an object, it holds it vaalue anf cannot be changed
2.Rest parameter useful for a function to accept any number of arguments. o write such a function, you put three dots before the function’s last parameter
4.serialization is a converting of data to a flat description so i can be stored and transfered.
5. JSON is popular serialization format.
6. 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.
1st Part
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?
Large and different sets of data
What variable type can be used in order to solve the problem of storing multiple values?
You need Arrays
2. What are properties in Javascript?
Simple said they are Values
3. Which values do not have properties?
Null and ofd course undefined
4. How can we access properties in a value (two ways)?
When usind a dot . value or brakets. my.property
versus my[property]
5. What are methods?
Methods are properties that contain functions
6. What are objects?
An object, is a reference data type.
7. What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
They can hold different datatypes in it`s own property and then you can play and change the values of that.
8. How do you define an object?
You use braces as an expression. And the properties of the object should also contain a name
let school = {
name : "Cardano Academy",
location : "Europe",
established : "2017"
}
9. What can you say about the mutability of Javascript objects?
Tha object values can be modified and changed
2nd Part
1. Why can’t you add new properties to a string variable?
Because a string is not an object
2. What are rest parameters?
With the rest parameter you can represent an indefinite number of arguments as an array.
3. What is serialisation and what is a use case of serialisation of data?
Means you can convert data into a flat decription of itself
4. What is JSON?
JavaScript Object Notation – THE data storage of our choice !!!
5. What are the differences between JSON and the way programmers write objects in plain Javascript?
- All property names are sourounded by double quotes “ “
- Only one simple data expression is allows
- No function calls and
- NO Comments, who need comments in his data store
-
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 weresquirrel needs more than strings and integers, it also needs booleans and arrays. Also, having individial variables will lead to more confusing code. Need a way to keep the variables organized. -
What variable type can be used in order to solve the problem of storing multiple values?
Arrays can store multiple objects of the same type. Objects wil allow you to store various variable types. -
What are properties in Javascript?
A property is a characteristic of a value (ex string or array). For example the length of an array. -
Which values do not have properties?
null and undefined -
How can we access properties in a value (two ways)?
With a dot (value.property) and square brackets (value.[property]) -
What are methods?
A function performed on values or objects. -
What are objects?
Is a collection of variables of different types. -
What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
Object are a collection of variables. The object holds many values and is used to access the variables keeping the collection contained and organized. -
How do you define an object?
let objectName = {variableName: value, variableName2: value, …}; -
What can you say about the mutability of Javascript objects?
Javascript objects are mutable as their values can be changed
SECOND PART:
-
Why can’t you add new properties to a string variable?
Strings have built-in properties but new properties can’t be added, strings are immutable. -
What are rest parameters?
When used in a function, allow a function to allow an indefinite 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?
Converts Javescript code into a serialized format (string). Used for file storage or transmission to another computer. -
What is JSON?
Javascript Object Notation. A standard for serializing data for storage or data transmission. -
What are the differences between JSON and the way programmers write objects in plain Javascript?
JSON does not allow function calls, binding calls, comments, or anything that does computation.
- the easy extraction of a single string inside multiple strings2
- an array
- values have properties like maximul value, length of a string etc
- null and undifned
- with a dot or inside brackets
- methods are properties that contain a function
- its a way to store and structure properties
- they hold mulitple data types
- by using braces
- the contents can change for objects but not for strings
1.Chapter introduces a problem of multiple variables, values being able to access at ones.
2.Arrays.
3.Properties hold data that are specific to a given object instance.
4.Null and undefined.
5. With a dot . and [ ] square bracket.
6. A property that holds function for a type of value.
7.Objects are values of arbitrary collection of properties.
8.Object ties different properties together to express a single condition.
9. By using braces, properties inside the braces are separated by commas. And each property is named.
10. Objects can be moddified.
Part 2
1.Values of type strings are not objects and immutable.
2. allows a function to accept an indefinite number of arguments as an array, providing a way to represent variadic functions.
4.Serialization is the process of converting data structure or an object state into a format that can be stored.
5. JavaScript Object Notation.
6. JSON looks similar to JavaScript’s way of writing arrays and objects, with a
few restrictions. All property names have to be surrounded by double quotes,
and only simple data expressions are allowed—no function calls, bindings, or
anything that involves actual computation. Comments are not allowed in
JSON.
1.Data structure is needed where many info can be stored at once which can be done with an array
2.an ARRAY
3.define the elements in a value
4.null and undefined.
5 with a dot. and square brackets
6Properties that contain functions are generally called methods of the value
they belong to
7Values of the type object are arbitrary collections of properties.
8.objects can hold as many datatypes as needed
9 variable …name = { …}
10.the values in objects can be changed unlike the rest.
1.because they are immutable
2. a function to accept any number of arguments.
3.converting big data into a flat description, + transferring data from point a to point b
4.json is A popular serialization format
5.All property names have to be surrounded by double quotes,
and only simple data expressions are allowed—no function calls, bindings, or
anything that involves actual computation.
1- Two different objects (squirrel and human) with different values that can be stored in arrays.
2- Array
3- Properties are expressions of a value in the array.
4- null and undefined
5- value[ i ] or value.i
6- Methods are properties that have functions.
7- Objects are values that have properties. We can use { } to create them inside variables.
8- Objects allow us to group multiple properties with their values.
10- In objects we are able to change the value of a property and the same value can have different content.
1.1- Because strings are not objects and the language does not store the added property.
1.2- The ability of a function to accept any number of arguments.
1.3- Serialization is the ability to save and convert data to a file that later on can be stored or sent to another computer.
1.4- JSON is a serialization format.
1.5- In JSON all property names need to be surrounded by “ “ , you can’t call functions, bindings or anything that needs computation.
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 solution to the weresquirrel problem is objects. Objects contains more than one values.
What variable type can be used in order to solve the problem of storing multiple values?
objects
What are properties in Javascript?
properties in javscript are associated with values and we can access these properties using .value[“properity”]
Which values do not have properties?
null and undefined does not have any properties
How can we access properties in a value (two ways)?
value.properity or .value[“property”]
What are methods?
methods are function that exist within the property and they act on the value which the property is a part of.
What are objects?
objects are collection of values.
What problem do objects solve that cannot be solved with other value types we’ve learned so far (such as integer, string, array, boolean etc)?
problem of correlation. objects can store multiple values, such as integer, string and array and boolean in one.
How do you define an object?
let objectName = {
property: value,
property: [“value”, “value”, …]
};
What can you say about the mutability of Javascript objects?
there are some property such as length that cannot be changed in Javascript. and these are not mutable.
Why can’t you add new properties to a string variable?
you cant add a new properties to the string variable because string is a immutable variable and cannot be changed
What are rest parameters?
The rest parameters start with triple dot(…) and it goes through the whole array or string.
(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?
The serialisation data is constructed from the RAM location in the hardware which correspond to binary values which is represented.
What is JSON?
JSON stands for JavaScript object notation and is one of the most popular ways to serialsation of data.
What are the differences between JSON and the way programmers write objects in plain Javascript?
The difference between JSON, and JavaScript is that JSON doesn’t take any thing that requires computation such as functions.