Please enable JavaScript.
Coggle requires JavaScript to display documents.
Javascript (this acts as a placeholder, and will refer to whichever object…
Javascript
this acts as a placeholder, and will refer to whichever object called that method when the method is actually used
-
-
-
Default binding
this is the global object (in a browser, it’s the window object)
Fucntion calls
-
-
.bind() returns a new function, with a certain context and parameters. It is usually used when you want a function to be called later with a certain context.
-
-
Own vs Inherited Properties
Object.create(obj) — Creates a new object with the specified prototype object and properties.
Inheritance by reference
If an objects which inherited that property will share the same mutation. But if the property is replaced, the change will not be shared.
-
-
-
IIFE(Immediate Invoked Function Expression)
usually used when you want to create a new variable scope
Using IIFE:
Enables you to attach private data to a function.
Creates fresh environments.
Avoids polluting the global namespace.
-
A common misconception is that const is immutable. It cannot be reassigned, but its properties can be changed!
-
Context is most often determined by how a function is invoked. It always refers to the value of this in a particular part of your code.
-
-
Prototypes and Inheritances
Object.getPrototypeOf()is the standard ES5 function for retrieving the prototype of an object