Operators

Operators

Wa maxey Operators ? operator wa waxa ino suuro galinayo inan badalno variable macluumadkiisa ama aan isku darno labo variable macluumaadkoda.

Waxa jiro noocyo badan oo operator ah, waxa kamid ah Mathematical operator,

Comparison operator, Logical operator, Assignment operator.

Mathematical operator waa operator ka la xariiri xisaabaadka sida + – * /

 

Plus Operator (+)

javaScript + operator labo shaqo ayey ku qaban kartaa:

1: iskudar ka labo xisaabood

2: inaad mideyso labo qoraal.

Tusaale
				
					const firstName = "Ahmed";
const lastName = "Yare";

console.log("So dhawoow"+ firstName + '' + lastName);
				
			
Sidokale waxey badashaa nooca varibale_ka qeebtan gadaal ayan ka baran doona.
 
Equal Operator (=)

javaScript equal (=) operator waxaa loo isticmaalaa in variable aad ku shubto macluumaad.

Tusaale
				
					const name = "Ahmed"; // variable 'name' ayaan ku shubney magaca 'Ahmed'
				
			

 

Greater than >

javaScript greater-than (>) operator waxad isticmaali kartaa markad is bar-bardhig ku sameneysid labo waxyaabod. Comparison operators wey badan yihin waxa kamid ah: greater-than >, less-than <, greater-than-or-equal >=, less-than-or-equal <= .

Tusaale
				
					const x = 3;
const y = 7;
console.log( x > y); // output: false 
				
			
Share