Hi all,
Hi all, as always excuse my poor english!!1 Please let me know if youre reding this so I dont feel so lonely in the process of becoming full time crypto
- Read the sub-chapter called The weresquirrel. What problems does this chapter introduce that cannot be solved with variable types such as strings or integers?
It introduces a problem where one guy transforms himself into a squirrel, so the guy intends to keep a log or a journal of his activities during the day, so later on he can check the log and try to find out why is he transforming. -
What variable type can be used in order to solve the problem of storing multiple values?
Objects and arrays!!
3. What are properties in Javascript?
Properties are characteristics of an object, often describing attributes associated with a data structure.
4. Which values do not have properties?
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 withsquare brackets. Bothvalue.xandvalue[x]access a property onvalue (i just copy and pasted this answer)
6. What are methods?
JavaScript methods are actions that can be performed on objects
7. What are objects?
objects in JavaScript may be defined as an unordered collection of related data, of primitive or reference types, in the form of âkey: valueâ pairs.
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)?
mmâŚ
9. How do you define an object?
hereâs an expample:
let escuela = {
name : âEscuela E653â,
location : âConcepcionâ,
established : â1983â
}
10. What can you say about the mutability of Javascript objects?
The types of values discussed in earlier chapters of the book, such as numbers, strings, and Booleans, are all immutable⌠but for objects, that is not the case , you can change their properties
SECOND PART:
1. Why canât you add new properties to a string variable?
Bacause they are not objects, you can try to put new properties to a string, but they will not be stored, and JS deosnt complain, so its kind of dangerous.
2. What are rest parameters?
it is the ââŚâ that is used to denote when a function can have any number of arguments. You can also use the rest parameters when calling a function, to tell the function that it should perform the function in all the elements of the array, one by one
3. (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?
I dont know ⌠we didnt cover that in the reading
5. What is JSON?
is a lightweight data-interchange format. It is easy for humans to read and write. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others.
6. 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, oranything that involves actual computation. Comments are not allowed inJSON