0% found this document useful (0 votes)
36 views14 pages

Samuler

Masturbation theory

Uploaded by

Shammi Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
36 views14 pages

Samuler

Masturbation theory

Uploaded by

Shammi Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
| SS Jev cserpt with Raplain passing Pameters % enample Program. Passing Prameters ih Javascript vekers to the proce ss of providing input values to Q function phen {t is favoked. these parameters get ag placeholders in -the sfunctlon defination And the values Fou pass when cating chee teeter aan called arguments . Program + Passing Paremelers to a functor. M Fanckon deFinty on with parameters Function greet name sage) § Console leg (* Helle € fname y 4 You TEAS Olds) 2 a Function ett with arguments Greet (8Alce , 85): qreet C* Bob”, 309+ Kaplan ton’- an ¢ Sage 4- Wetining a ~funetion with parmme ters: gn the -function g rect Creme .age') «NGO and aye ove PHVame ters. valves these Parameters act as Pince holcter for Phat will be Called . tf Oh \ e when Greet Clotice “R527 és evllect: ALY : Atlice’ ug Peel ac the mlue x the name — passed when the ‘function me “ \ - a \ : ap! : : Calting a ~funckion with arguments. Parameter. A -ts PRSseA ac the’ value doy the age P wvameter thsiole! the Rincueln name fo now “atice " gerot! age is as. B- Using PITAmeters Insicle the funebon: the function CHECUES the Code insicle IE anol uses -the Passed value. gt logs: Hello 5 alice You ar a5 years old. 4. Leucing the function: : you can cal the same function with afferent Ra guments. q reek CB ob", 36) wilt (og ¢ Hello. Bubl you. are 30 years old. key points: *% Parameters are pire holeters Ce ae declaration. function RA 19 ments A the —funckion . ealtins are veusable < You are actual values passed woken ya Seapt fanetions ~ a org aments to prduce con ea — —— AHerent vesutts. fet me know if You did tke OF goktKonal enamples 1 1] Prove: odes Sh alee € “nether” lifter | Subsbi er From the | ulbstng (1 method 1 ! | The slice Cy method is useol fn Tovascrpt te entrot a gection of an Owrvey lov sting) anch weturn ft ¢ PS AST A New wrimy Cor Séring) , witheyt} modcFy} 4 qi ‘Fging the enginal one. Syntons— “Java Seript- array « sitce (start, end): ¥ Start Copttonal): athe inden at which the _ entvaction begins Hf emitted, °t defaults to © ye end Coptional )* the inden at which the ertroution ends (not tneluded In -the yesult)- AL emitted {6 defaults to the arvay!s length. key points: 4. the onginal avray 07 Steing, fs not changed. Q- alegative Indices Can be used to Counke frm the end of the array Kuamples with Array 6 Javea sevipt - —=gE c te a onst Pyuits . (Maple, “banana “chery”, ‘ate’, M Fertoct tom tnolen & to the ring. Prults = Fratts. Console eal const emay slice (a); » boy (remaining Eratts) ; Hl output ; ie ‘chery ") “aar] use Negative — inolen. const . lagt Twa fruits = = Pruits . gilee (-2); Console « (0g (bask to; Fruits ) ; i output, [cherry ", Uae" } I orginal say 18 unchanged Console. toy (fruits): Houtput : Lappe", “boo ana “Cherry 4 date] Rxarnples with stoings— : the slice) method also works on strings Bimilarly 5 : Javascript Const ser = “Helly world ’- Yo Rrtract “Helto” const Sliced ebr= Str. slike (0,5); Console> log (slited gh)« utputt- “ello” Fenty act “world " using negative fndices He worll = Str. slew C6, st = tog (world); console Output “wordy Pracbeat Applications:~ ¥ To erbroct sub Brrays * oy substing without affecting the Orginal data. | ¥ Io perform simple Closing operations ben asvay Slices GO] velurns shallow Copy of the Orrag. , Anplain about function Alefinttron, function cating , function Parameters, funckion return type with a ° Suitable examples in Tava senipt. Functions ore a fundamental pave of Jam senipt allowing You to write yeasmble blocks of code befor is an enplanation of the key Conegtst | IW. Fench’on defination - | 6 function is defined using the Function Keyword Followed bye x A name for the function: ¥ pavanthests () Cohrch may incluole Payameters ) 4A Wock of cece inside {% that contains he logic the function erchdes. Syntan,— vem pt fonction Punetioral Mame Cparvameter ) i cule) | oe body Ccoole to. enecu 4, do erecule a ~function you “call”, i& by us tts name Jollowed by paronthests . Hf the -Functton takes Parameters , you pass them Inside the prvantheses. euntan Java Semel function Klame Carguments); 5. Fancton Porameters i- Parameters definition they allow called. eqn Java Jeript H function function Mame (pavomeler 2 fctrametera)' fluse Parometers include the Lunchon nye placeholders in +the Fane Hon the function to accept Input when when calling the Function , values Carg uments) ave provided to yeplace the parameters. t Fancion eter ype’ b cfanctton can 9 penalty yeturn a value’ using the ‘vreturn acai one ae she value ryetumed can be 6 (sbing » number , object ete) 4@ yy = No ve turn » Ned pike Ua] welun, 'S Pecifrcel , the function undley fined by defaule. S4ntox'- | Java scmipt functron furcton Noame() £ yo Values py. Returns a vale Rnample 4 (- Java Scvi pt function addtumbers Cob) £ veturn carbs // Retwns the sun % kee sums add Numbers (5392/7 sum gets the | returned vatue (8) Console «log CMsum:" 7 sum); . : \ oulpe sums % &- Function HeFMmitfon'— Rnample * | Tavasenet | function greet OO a - | console . log C4 Yello / coor let j | a. fanchion ealtingr- s Enarmple « a, Se “Java sent greet C1; Llout; Hello » Loox |e ! By Function parameters .~ FR nample - Tavaseniplt- Tanchory Greet user (hame) fa Shame! ve q pare —Metey Concole-Cog (* 4el1q" ye name 4'1’)5 J wet usey (1 Alice’) ; output Eetlo » Abice what is Dom «¢ How +p access bom elements ueing Fave senpe2 She Document object mode! Coons) § Re programming Interface that reprecents the Chyucture Of 4 webpage AS a tree 0 € Ohfects, | rE alles develepes to interacts with and manipulate HTmb anol Css using Jara Scripl. | The eom predues away bo olynrarnre orlly update centenc , Structure ¢ ancl styles of @ webpage volthout re tecling re Lxample!- chimes a _ Zht> Hetlos world dlhody > dlhtmts | ic ve presents as a pom tre that javascmpe fan tnteraet with sttow fe Auess Qom elements using Javascripts Java sen'pt Prorcles Serveral methools aeess and Manipulate Pom elements- ds Access By TD Use document getKlements By TAC) access an element bart @ spelt td Re tT Mle Zp id= “ny paragraph” > ello

Zsonpt > Ret element : a document - get Klement By To (Ymy paragraph ) Console - Lag element text (content):