Strings

Wa maxey Strings ? String wa xarfaha aan isticmaalno ee A-Z waxaana inta badan xarfahan eyku jiran qoraalada sida jumladaha iyo magacyada.

Ogow: javaScript waxkasto oo quotation marks “” aad dhex galiso waxey u arkeysa iney yihin string.

Tusaale

12345” javaScript waxey u aragta string ama qoraal.

Template literals ` ` wa qaab cusub oo aad strings u qori karto adigoo aana isticmaaleynin plus operator.

iyadoo aana la isticmaaleynin template literals
				
					const magac = "Ali";
console.log("Welcome " + magac);
				
			

 

Iyadoo la isticmaalayo template literals 
				
					const magac = "Ali";
console.log(`Welcome ${magac}`);
				
			

 

template literals waxey caan ku tahay calaamada back tick ` `

Template literals intaana javaScript laguso darin waxa jirey qaabkale oo la isticmaali jirey marki aad rabto inad line cusub bilowdo.

Tusaale

without template literals ⬇️

				
					console.log("Waxaan ahay ardey \n waxaan baranaya programming maanta");
				
			

ogow \n micnaheedu wa bilow leen cusub.

 

with template literals ⬇️

				
					console.log(`Waxaan ahay ardey
             Waxaan baranaya programming maanta`);
				
			

Template literals markad line cusub bilaabi rabtid waxad taabaneysa ookaliya return/enter key.

Template literals waxa javaScript laguso darey ES6 version.

Aqriste waxaan rajeenaya inad wax badan ka fahantey qormadaan aan ooga hadalney Strings.

Next lesson >

Share