ES6 Topic 2020
ECMA---- European Computer Manufacturers Association.
Provide Standard to javascript for Different Browsers
ES6 (6th edition) in 2015 also called ECMA Script 2015
ES11 (11th editon) in june 2020
ES6 strings.methods case sensitive
ES6 strings.methods case sensitive
normal array
,,,, skip array
rest array
find
findIndex
example with array
example with array of object
example with custom function
CLASS, OBJECTS, INHERITANCE, CONSTRUCTOR
Class is a colletion of object
inheritance use for object method and properties add to another object with the help of class keyword
what is classes
Make class and call it
Define constructure property and function
make class instance
OBJECT--- propertiy, method(functionally)
Any function that is passed as an argument is caled a callback function.
A callback is a function that is to be executed after another function has finished executing -- hennce the name 'CALL BACK'
kuch kuch samay baad hame kuch data chahiye
2s bad roll no., 4s bad name, 6s bad marks
Promises => event loop, closure, promises, async/await
promise stage-1 panding = resolve, reject
promise stage-2 resolve
promise stage-3 reject
isFinite = if number given true other false
isNan = if string given true other false
power define karne ki liye 5pow3 5*5*5 = 125
Import and export function
whtat is default export and normal export
import class with different way
module allow to one file some code to use another file
code like -- funciton, var, class, let, const, object, array
generators - push, resume, like debuger
yield for step create
generators = wich function who push and resume
Synchronous --- A synchronous request blocks the client until operation completes, javascript engine of the browser is blocked
Synchronous --- jab tak ek kaam khatm nahi hota aap dusre kam ko start nahi kar sakte
Asynchronous --- AJAX Web-Application Model
Asynchronous --- In such case, javascript engine of the browser is not blocked
Asynchronous --- aap ek kaam ke sath 2 kam bhi kar sakte ho or uske sath 3 kam bhi kar sakte ho isme koi boundation nahi hoti
map() normal array
map() return new array
map() 3 argument pass in this --- element, index, array like foreach loop
filter() return new array
reduce ek value return karta hai
const numbers = [45, 4, 9, 16, 25];
call == the call() method is a predefined javascript method
ek object dusre object ke method ko use kar sakta hai by using call() method
by this method, we can bind an object to a common function, so that the function gives different result when its need.
bind == kisi object ko common function ke sath banth/bind sakete ho
the apply() method is similar to the call() method
the call() method takes arguments separately
the apply() method takes arguments as an array