Javascript Level 2
Javascript Level 2
Var a Page
name "kiran",
class : BTech,
number: 123
a. narne Mes"
upddtng
Ấvanced
s
ESS ESG
4 Var let
Const
3
Console.logi), asgale.lg);
Console. Iog(i); -acesible
hot acesstble
var is qccessed qll over the tun,
3)Var adds tsel to HỘ let,canst.dont add.
Loindow object. to windoo obfet.
Page
4indo ohiect
Js langug me kai sare aaise teturos hai, jo
hum Use Karte hai ,par vd S me nabi hai
windouo
alert, prompt are proy} oled
brou) ser.
Ls Stack
Ly heap ab.c,d
texecured
|+2+3t we
direc Com pue this , b
hous Conputer does
functton abcd ()
exec. Cortr abc
Yar a = 1D,
Function hello () Vanab funen
Nar b he llo)
lextca
mSopg}efence values
taq. Var a - Li,2,3,4]
b=
Var a wrong
*using spead operstor.
Yar b = L... a] → this is bao it is done
Yar
-truty vs fal Dote
3
ese
exerted
for Each
→ only applied on artas
Var a = This Funcon run's tur
Nal eve elenet og arrag
a. torEach(Functton Fun cion (val)
3)
This heNer update's AnonmoS
Punion
4he original arrq Le, wthot name..
-- for in
i al keyJvalue
callback function's→ Asgnc Part o ,classmAte
→ this is a funton ushich run's atter Date
yar a = Function c{
Cansl e. logl" Meous';
olp: Meow
21S
LI, 12, 1s
-3-2-|
ngthive tndices
a2 l2 -2:2
--biher order Puncson alAssmte
function abed()
return funchion(>
Constuctar funchon
→H is the pe o ngtmal funcon in which this)koooe
is used g while calling thed uneton Oe use jnew 19
price
funtion make&iseuit c
4his, width = 10 +his price price:
+his.height - l6;
+his, c\or = er Broop":
Sugarg"
hoard
→t alcgs createls a blank oķiect
ife immediately invoked fun cion expression.JASSMAte
H is the oay to run a tuncion imme diate
anol create private vaiable instde t
(Funchon(o
Var a =12;
)O
when ortte this, t becs els iite
return 4 )0sn
return
aetter; Funchon)
(
console. lsg a);
Setter: Puncion(va)t
a= val;ie
--Pntetgee clAscMAte
e
Var got bnuoser,consol
name:Kiran"; tpe ohi
here, oill be name' în
bet also tt pratutypej)}d0
→0e dor't create t then ? t aomes oth eve obje
g ct
S provi ded by javas cript.
prototypial inhettance
acce ssing propertes o ansther class.) Funchiandbied
eg there are humans sho can do several tasks but
also there are sheriyan's students oho Can do some
t their oon tasks plus al) +he tasks t human.
Var human =
Can Talk : true,
Can Aal k;true, Girenshihk
CanPy : false
Var
sheriyanStudent
create Awe Some lebs : true
crete ALoarded ebs: true
0 in globa scop
e Date
Page
console.log(this):
Ly wingous
call, appbind
it you hae d tunchion and a object. & Hou uoant to
run that Funchon burt aso ou uOan thet the
by detautt value ot this o be changed to object
then e
appy thee nethods.
alFunchon abcdc ) this, name
Gonsle. logCthis); 3 deautt behavior is nsuw chagrd
Var obi=name;meow'"
Funchson(val,yal2, val3)
Console. log (this, vall,val2., );
Var obj = namekiran"})
abcd.a call ( obj, 1,2,3); > X oong
#bind
pure Funchons
1.+ should aloas retutn eame ourtput tor
2. H oil) never în
Same