Functions
Arrow Functions
a.k.a. Anonymous functions, or Lambda functions.
Introduced in ES6.
Arrow functions do not have their own
this
value.
Here in this example, when we call this.name
from msg.arrowFunction()
, it looks for the name
variable in the global context and cannot find it. Therefore only Hi gets printed. if we try to print this.name
it will return an empty string.
Generators
a Generator function is a function that generates iterator.
Immediately Invoked Function Expression (IIFE)
a.k.a. a Self-Executing Anonymous Function.
a JavaScript function that runs as soon as it is defined.
let us group our code and works in isolation, independent of any other code.
this
keyword refers to the owner of the function we are executing.
Async Functions
Promise
When resolved it makes the result available
States: Pending, Fulfilled, Rejected
Promise.all - takes multiple promises and returns a promise which resolves when all supplied promises are done.
Promise.race - is the same as Promise.all but it resolves when first promise is done.
Shared Array Buffers & Atomics
An ArrayBuffer instance represents a piece of memory: binary data
Typed arrays are needed to access data in an ArrayBuffer
The SharedArrayBuffer is an ArrayBuffer for which underlying data can be shared across threads
Atomics global variable provides a collection of tools to work with the SharedArrayBuffer
Last updated