Professional Documents
Culture Documents
Ad Js
Ad Js
Ad Js
Topics
Dom, Dom Manipulation, Setting CSS Styles using JavaScript,,
Iterators and Generators, Promise, Client-Server Communication,
Fetch, Asynchronous JavaScript
Difference b/w DOM object and WINDOW object
For example
document.querySelector()
WEB APIs are basically libraries
that are also written in JS and are
automatically available for you to
use.
Synchronous JavaScript
THREAD OF
EXECUTIO
N
Blocking
THREAD OF BACKGROUND
EXECUTIO
Callback will run
N
after timer Timer
running
REQUEST WEB
CLIENT
SERVER
💻
(e.g. Browser)
🌐
RESPONSE
Sending Data Back
Callback Function
Example of Callback
let obj ={
value1:number,
You want to use value2:number
for...of loop on }
this object literal
🏷 You can think of generators as a kind of function which can return multiple
values in phases.
🏷 The function* is the keyword used to define a generator function.
🏷 yield is an operator which pauses the generator.
🏷 yield also helps us to receive input & send output.
Generators Example
Contains
Class Prototype methods
Can access
Instance Object methods
1. Constructor Function Demo
.prototype
Constructor function Prototype 🆕 The new operator
[Person()] [Person.prototype]
calcAge: function 👉 An empty object is created.
.constructor
Prototype
Object
[saquib] [Object.prototype]
[Object()]
__proto__: null
.__proto__
Prototype
Object [Person.prototype]
[Person()] __proto__:
Object.prototype
.__proto__
Object
[saquib]
__proto__:
Person.prototype
ES6 Classes
Inheritance Example
Person Class
extends
Student Class
Link to resources