4dwduct: Jaa Seripl
4dwduct: Jaa Seripl
3. ky Typu shlnundsstakmerts
Deelaalien veluu
a Vaiebe Vatoblu that holdi data
Pahee : Decloe
Let x l0j
Cet noMe Jokn
Let -30;
b. Aulgyuand stalmerk
a value to a fuviauly dalaud vaiadke
Synian :
x-0,
Examplkwatlane
: "Bob';
qe 35;
Dclaustion and Call stabmenli
CFunclion invotu hum
tock (funation)and
fuhe : Daine suuate code
to treute' dhú Loqic
tundien qedt()
Cengale.logl'Hello, Norl4");
kranfle
tuntion add Cx,y)t
Console loqloutt) ;
(, thu, slu )
d. Condi tienal slatnunt gyass llat baud on Condihon
Coruol tle fos o gso
Pufeu i
tlan to' ),
Cendoler loyl"x
Losping staknusda Cfos, wile, Do bohtle)
forllet i= 0; (esttt) 1
tonole loyl:);
tor let izo, ie numbu. lngth ; itt)
Corsol log lnum buali3);
4. Rlun state nunt
This is a
Multi- ki Cormnunt
Bhat shons Mulb lns
nane= John'
let
Cont pi - 3-14;
Naciable) Serd
b. as (fundien -So pad Vauable in Java
true)
let city "London'
centole.loglihy);
= null;
e d to
ond iuubble vale prinaaily
6. Symbol: A urigue
proputy key to objpiti.
add unique
1- Biq Tnt : A type that con
Tepreend integua with arbtlary
nunbuy thát
extecd tae Aleumbs type's imi.
Czomple i tet lasge Nleurmbu 123456 189 (o 11 254 50099
94364ny
b. Nan- Printtive Data Types
Non- Primihye data types, alo called rojunu typu, ae pme
conplea than prindhve typ
shings , and valoes an be ony dalatyp
Addag &letenda:
puskt) : hdds an elenund to the end of tu auay
let au Et, :]; unhulf (): Ackd4 lenud io begisag
ar undhat Co),
Conuala loglac); Conso le . log larr);
c
Padezirg, but ou com achavt in wing cudons logi
lad aninaloninal lergth.1 J;
lat
Molhd'
Java
angional Aa wttktn drTay, knosn a
mulfi-
Soript Sont armo
Examfle i et natix I[t, 2,3),
I+5,43,
[1, 8,9J;,
J;
1 Shing Declaalion:
e double qoola :
let nan "Tohn";
shiny bpubu:
: tehuns tu nunbu of charackus io a ching.
. length
tel meag = Java Scripl";
3 Coruneon Sting
Conveat the sbing to upiucau
obpperCau (:
coruele. log l( "be lo oto Uper laul );
funclienu in Java Scaipt
tuncton au veuable locks of code dagod to puform
tauks- Thes tate npud, prec it, and oun an ouhet
heitie
key Fealu of funtion
1. Funclion Declaation :
funtien qpet Cnamu )e
eun 'Hello, non y.;
Cend- log [gnet ("Alie );
8. Parants and Argursunt:
to the furhon when it i cal
Ayuraent i lalues paad
3. Fancions bxreuion : lable:
a funchon to a var
add- tuneton Ca,b )N
Cot
Tetn atb,
5 Dfault Poranulas
3
Cais color "Red';
Swileh day)
Cae
3pohile (i<s);
4 tor..of Loop:
ovu terable ohiul ike arnayn.
"Jkrabs
I'aple ". "banans', "chenyJ
let truitk
for Clet hit &tuit ){
contole
5.
fon..in koop:
(let y in Cat)e
fon
cordelog(ey,carltq)