0% found this document useful (0 votes)
27 views

JS Assignment 2

Javascript notes unit 2 sppu entc

Uploaded by

Madhura Peshave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

JS Assignment 2

Javascript notes unit 2 sppu entc

Uploaded by

Madhura Peshave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

PAGE NO.

DATE:

ASSIGNMENT-2
QElab orate the ype conversioh wed in
Tavascript
Tavaseript ik a Looacly typed langunge and
most of the.
Canverte a value to
timJavascript
Tavascript implicltly
th rate type but
there
alao CaAes ohere nud ticrplicit ly
Ly
do type conversion.
co
Converting valuee t shing
Concertibg vaues ta Nuober

Converting values
The vakript Sbing ) and to ctrinq method
cah be wAedin JavaScript to convert
Vaue to a
fting
Syntaxi
Shing (álue) oe
Vaiakle Nametnshing
Converting Numnbers nto Stringi
let
let v2= 333:
consola log "Type af ve befot canierslon "
typesf
Conversion
cund type.of V2 be foae
+ type
condale lag Type of V aftr Convhoiob :
Ahing (v)and
+ type of Ahing v)t typeo£
V2 afttr converso n + type 2
totting O):
PAGE NO. PAGE NO.
DATE DATE:

Qr2btch art the tormination statemept IlCreate empty ohjcct


TavaSeript?
A teroiahon tatement let
to aSemicolon ued at
the end statnent to signih cnd ol Add poperieg dynamically
that statement person.name = "Tobo Doe "
Thi helpi th Javareipt Interprtt undestand Mustng dot ootation
Lobere shaterment cnde and anothr
beglna pertonageao:
Ih
Javascript Semicolonu at technically optional perton [ob"] "Soltware developtr";
becate the Janguage Incudes a featur calle wing bzacket notation
Automation ceicolon Tn4crtàn ASr)
AT alloust Tavascnipt to autaabically persan Countny]s USA'
Jnsertioh semlcolon In certain situatioh
ohere they ae miscinq guch a at the end I/Adda nethad dynamlcally
o a line
onA.sT Can Dmetin
lead Houoeverllng
t unLxpechd behatour , n E qenerally contolelaq ("Hellomy nam Jn"
otcommended Remlcolona explidtly to thic hame
auoid patential or mitunderstanding
L1n th code the pnpertie
consolelog (percannam)
let lo;
console loq () cOnLole.loq peraon [Tob'])
Da Create a object. in Tavascript and add dittr MCallingthe method
paoptrhies to that ohjct dynanically
Tn Tavascrípt you can create an obleot Qutputi Hello,my name TohnDoe
anddynamically addproptrbez to it
dot Dotation bracket notation
PCE NO PAGE NO.

DATE DATE

hype ol aperator Jn TavaSaript ? 6Symbol":


Lit out values eturned hy type O Hben the value Is a sy mbal a uniqLe
aperator and mmutable primitbe Value

Ih swascript the typeof optrator 1 ued


to defermine the type c a given perond
TH Sting ndlcating the hyp. 7functhibn'
of the apcrand When the value I a funchion

Valie Rekuanad hy typeof opecator Tavasript,unchion at objeck but


Tn
1wndelined
undetinLd
have thelr oon type
alhen the value
g2 hypcof undeinud ADshat are diftereot loaping statmcnte
Tava Sacipt Elaboxate any
2boolean"i Soctpt pngram.
When the walue boolidnhru or falie
) Lshile loap
) daohile loop
nuober
Whon th value la a numbey (both intqer 5) for of loap
Land tloatng-pont numbtra)
Lor Ihhalialization : condihon; increamcnt
decreanent

Llhen th value
Ane reptLcntnqatqeraaith arbitany
patteton.
123n uobile loopi
The Javascript abilk loop iHerate the
5 element foy the Infinit humberof tinee
hen the should be ucd number of teratiah
4 hypcaf "helo";
PAGE NO PAGE NO.
DATE DATE:

Suatax'shlelcondition) 4tet ihunchon 0


Canolkloq"Hello. "+ thishame:

do while loapi uing object coatru dor i


The Javascript do obhile loop ierate th Cont person = heo ab<ect O;
clerment for the Infinite number of time persob hamL =John
Itkeohile Ioap
But,code e executed at least one wbether perton.qrtet = funotion
canditbD. 0 fale Conioleloq ("Hello," +thianamd:
do
Ilcode to becxccuted canatructar funchibp
2ohile Cconditibn walng
4mq clasryntax
Javaccript to
The Toyascript for In loop& ued to terate avasceipt inbuilt ohËecta
the prrper be ot an obiect we ol|discuu DGlobal obfecta Ohject funchon ,Anay string,
Labout Javascript for In loap number, Boalean cymbol, Big Int
Qrexplain obj ccta In Tavascript and ist diereot 2)0 0hiecte: Er-ox, TypeFror,RanqeEn
Tavascript iobul! objecti RekrtnaEzor Syntox Ertr
Dhpeck. Tavasccipt ar dynamic
add, modity
Can deete and bitoise sbift aperato In
meanlnq
paopertie
Cteatcd
after the ohfect h a been
Tavasceipt.
The Bitolee gperato perferm bitwlce
operatbn apcrand
Creatin abjeck i
Ohject Likral Cyntai Optrato Deacctptton
Ritwtre and
hame=Johh Bitwtce OR
agei3o Bitwise XOR
PAGE NO.

DATE:

Bitwtre Not
<< Bltofselett shift
Bltwicet¡ht shift
Bitoredgbt shift with zen

Bitolse eft chlfti

Descciption: Shife the bis of X to the left by


Yposttibns. Ans bit ch1fkd off to th left ar
discardadand y sb1fted In fmm
the s¡ht
Rlabt shrêt (>): X>Y
Deacrtphion i
Shtftr the bit of x to the dght by Y
posltionu The operatibn pratrvee the
(The leptmottbik/calledas sigh bit c
preacred huqatie humben), meaning E
Alla Inotth b i t ofor tVe
and 1 tor-V)

You might also like