Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 3 Digging to the Roots of JS (this keyword (its dynamic, depends…
Chapter 3 Digging to the Roots of JS
Closure
access data of function out of scope
only functions do
objects dont
this keyword
its dynamic
depends execution context
it's not works like other languages
good uses to use a function in differents contexts
characteristic execution function
Prototype
characteristic of an object
Link two objects
a series objects linkeds calls: prototype chain
homework.toString()
doesnt exists e Object.prototype.toString() is called behind of scenes
Iteration
pattern
for(let a of arr){}
operator
...
var vals = [ ...it ]
Iterables
ES6 basic data structure/collection types
string, maps, arrays, sets and others
example map
https://codepen.io/RibeiroAmerico/pen/RwPGxWy
Object Linkage
how to link
var otherHomework = Object.create(homework); //Link object to other