%o ECMAScript also defines certain >e,#ordsand literals and

 %o open Scratchpad 7Shift?0)9? select GScratchpadG fro? the G+eveloperG ?enu? #hich is under the ?enu in 0irefo8. It opens in a separate #indo# and is an editor that ,ou can use to #rite ande8ecute JavaScript in the bro#ser. ?ou can also save scripts to dis> and load the? fro? dis>.7Hicture 2 sho#s Scratchpad92.3.3. ‘asicsJavaScript borro#s ?ost of its s,nta8 fro? Java? but is also influenced b, A#>? Herl and H,thon.JavaScript is case4sensitive and uses the ?nicode character set. JavaScript? instructions are called state?ents and are separated b, a se?icolon 7:9. Spaces? tabsand ne#line characters are called #hitespace. %he source te8t of JavaScript scripts “ets scannedfro? left to ri”ht and is converted into a [email protected] of input ele?ents #hich are to>ens? controlcharacters? line ter?inators? co??ents or #hitespace. ECMAScript also defines certain >e,#ordsand literals and has rules for auto?atic insertion of se?icolons 7ASI9 to end state?ents. =o#ever?it is reco??ended to al#a,s add se?icolons to end ,our state?ents: it #ill avoid side effects. 0or ?ore infor?ation? see the detailed reference about JavaScript?s le8ical “ra??ar.2.3.). *ariables?ou use variables as s,?bolic na?es for values in ,our application. %he na?es of variables? calledidentifiers? confor? to certain rules.A JavaScript identifier ?ust start #ith a letter? underscore 7?9? or dollar si”n 7?9: [email protected] can also be di”its 7/4-9. ‘ecause JavaScript is case sensitive? letters include thecharacters GAG throu”h GKG 7uppercase9 and the characters GaG throu”h GBG 7lo#ercase9.?ou can use IS< ((5-41 or ?nicode letters such as L and ? in identifiers. ?ou can also use the?nicode escape [email protected] as characters in identifiers.2.3.5. +eclarin" variables?ou can declare a variable in three #a,s;With the >e,#ord var. 0or e8a?ple? var 8 N )2. %his s,nta8 can be used to declare both local and”lobal variables.’, si?pl, assi”nin” it a value. 0or e8a?ple? 8 N )2. %his al#a,s declares a “lobal variable. It”enerates a strict JavaScript #arnin”. ?ou shouldn?t use this variant.With the >e,#ord let. 0or e8a?ple? let , N 13. %his s,nta8 can be used to declare a bloc> scopelocal variable. See *ariable scope belo#.2.). +ata structures and t,pes2.).1. +ata t,pes%he latest ECMAScript standard defines seven data t,pes;( 4Si8 data t,pes that are pri?itives;?’oolean. true and false.?null. A special >e,#ord denotin” a null value. ‘ecause JavaScript is case4sensitive? null isnot the sa?e as Dull? D???? or an, other variant.?undefined. A top4level propert, #hose value is undefined.? Du?ber. )2 or 3.1)15-.?Strin”. G=o#d,G?S,?bol 7ne# in ECMAScript $9. A data t,pe #hose instances are [email protected] and i??utable.4and of ob6ects as na?ed containers for values? and functions as proceduresthat ,our application can perfor?.2.).2. Convertin” strin”s to nu?bersIn the case that a value representin” a nu?ber is in ?e?or, as a strin”? there are ?ethods for conversion.• parseInt79• parse0loat79 parseInt #ill onl, return #hole nu?bers? so its use is di?inished for deci?als. Additionall,? a best practice for parseInt is to al#a,s include the radi8 para?eter. %he radi8 para?eter is used tospecif, #hich nu?erical s,ste? is to be used.An alternative ?ethod of retrievin” a nu?ber fro? a strin” is #ith