JavaScript Assignment 1
JavaScript Assignment 1
AssiGNMENT-1 0217002023
3M(A)
Ihasu Quustonsi
adiable declaatin ?
sasabes,but thuy
Fnb. n anSoikt, ae, lot,and cAnst as ubed to doclake
bahae dilliatly in tihms7 scote, kiding ,and mutalility .
"Hsistingi
"Scabe;
[at) is tlsck- scafed., maning it is confined to Hha block (uiti )
ich it is dclasd. ThiL makus t meke
sdictableab it asids
Umuntnal acess Qulsd
Ans
lat y-10;
lot a5;
"Mutabibta:
(3en
"Scopei
bleck in uhid it is daclaned and kannat Be aessud atside Nit.
"Haaing:
" Similas toe et|, Cmst is haistad but urimiialiyed, 8it has the
kame tmpeal diad zenl as at.
"Mutabilip:
.Const asiablu Kamst be sasiqnd Ence dcaed.
a Cemst aiable peint toan ohject s Housesee,
anay, the contnts thut
Censt z-10;
Z= 20; II TyfeErko : Assiqnmet to Constant yakiable.
Censt obi = {hame: Vaibhas> ;
Cbi. name =Bob'; lI Thi isalleused
Quo&2. hat ae
tighe-dsfunatins in Jaasibt ? Bueide
examles st at last tuse highe-Gdee tunetins and expläm thain.
USe cases. Dofine ushat athighs -Ahdt luntien is
lan be tliyed in Jou Scuiftt and kas st
fhb. Ahighck-Sde
aegkamming.
nctin in Iansoikt is afundtion that eithen:
(1) Takes Bne s msL unctisms as
(2) Ratubums aa functin as ie asult.asauant.
The mat unten isa tit -in highik -sdet undtien in Tasa Scifst
AAay , alie a qisen gunatien to each elemot,
f hD
e ecum
aibnjt
e
Sytox :
askay,. mafCCatlbackfundtin);
Extmhle: Th
D eo
CEngt ruumbshs =
Cemat [1,2,3,4,5, 6;
esendumbns = mbersufitbumb )wumbik 2== 0);
Consale. Jolesontumbsse); I/ Qutbut : [234,6]
Qus 3.Dsaibe the
and it Kemastt the Doumnt Chject Medal(00M)
siqniliance in eb
the utue bf a seb lage Deelatmint. Bplain her the DOM akst
and ous Jaunsit intiat uitk it to
mamibulate HTML andcss?
The Decumnt ayit (DoM) isa agkamaung intirface that
uL. Tha DOM AM A atidae botuyen web jase Contnt (HTML od CsS
<bedy
<þ> This is a sanle banagah.
z|>
(5) Rasending to Esent:- Jasn sit san Jistin to eent ihe cich
|body>
Jaun soikt Code (scilt .j)
II funtion teto change the tont sf he
fasagrafh
function changeTent () {
Cons fakagath =dBcumirt -gdtElimantbyt D(*tht );
pakagath.toxtantnt = The fasajpafh toxt tuu kaon
changed!";
,4,6,8,10] loalesenNumbens);
Otfut: || Censsle.
(bamplemay); qptbvenNumblhs esenNumbite= Canst
10]; 9,=[1,2,3,4,
8,
6,t, 5, amflefhay Censt
==0); numbee
2le (number= fte at. talsen
qotEsenlumbets
(ana) function
numbes ewen
Codei Scilt Jaun frb.
sage demenstatu
ih amd mothod ft the using Ancien
ment ahay. oiginal the om
humbors esen the ay
Asay naut ilknsa ahqunint
and an asAbes
fasay an
Taks that homtitn Jaunseikt a hit A