Please enable JavaScript.
Coggle requires JavaScript to display documents.
advanced js (Promised (how (using a promise (first()
.then(second)
…
advanced js
Promised
-
how
using a promise
first()
.then(second)
.then(function(data){
console.log(data);
})
o/p is this is 1 output this is 2 output
-
-
*1. resolve ,reject*
- make an first_function promisiable inside the function return --->* return new Promise(function(resolve,reject){
resolve("my task");*
};
3.first task is resolved successfully then second task then print the data returned**first()
.then(second)
.then(function(data){
console.log(data)})text
Es6
-
-
iterators
eg: array.
js recently introduced symbolic literals into its prototype of only itterable object. so check if an object is itteratable or not check whether console.dir(objectname);
1.maps, weakmaps
2.sets,weaksets
3.filters
-
inheritence
JS is an prototype inheritance
(using the characterstics(methods/properties) of parents object to child class is called inheritance)
note: root object (or) base object in js is Object.
prototype of root object. will have all the objects declared by user
-
Web Workers
1.JS is an single threaded
2.due to which when a complex task is running other tasks will be impacted.
eg: page is unresponsive window on browser with killpages or continue buttons on it.
3.solution: assign that complex task with webworkers and goahead with other tasks
-
-
-
-