Program to use Assignment Operators ( = ) JavaScript Language
let a = 5;
console.log('a =', a);
Output
a = 5
Steps Description
- Declare variable
a
- Initialize variable with value of
a=5
console.log
inbuilt function की मदद्द सेa
variable की value को display किया गया हैं
Program to use Subtraction Assignment ( -= ) JavaScript Language
let b = 10
b -= 2;
console.log('b =', b);
Output
b = 8
Steps Description
- Declare variable
b
- Initialise variable
b
with value of 10b=10
with the help of assignment operator=
- value of variable
b
is subtracted with 2 and assigned using (-=
) Subtraction Assignment console.log
inbuilt function की मदद्द सेb
variable की value को display किया गया हैं
Program to use Addition Assignment ( += ) JavaScript Language
let c = 5;
c += 10;
console.log('c =', c);
Output
c = 15
Steps Description
- Declare variable
c
- Initialise variable
c
with value of 5c=5
with the help of assignment operator=
- value of variable
c
is sum with 10 and assigned using (+=
) Addition Assignment console.log
inbuilt function की मदद्द सेc
variable की value को display किया गया हैं
Program to use Multiplication Assignment ( *= ) JavaScript Language
let d = 10;
d *= 5;
console.log('d =', d);
Output
d = 50
Steps Description
- Declare variable
d
- Initialise variable
d
with value of 10d=10
with the help of assignment operator=
- value of variable
d
is multiplied with 5 and assigned using (*=
) Multiplication Assignment console.log
inbuilt function की मदद्द सेd
variable की value को display किया गया हैं
Program to use Division Assignment ( /= ) JavaScript Language
let e = 20;
e /= 5;
console.log('e =',e);
Output
e = 4
Steps Description
- Declare variable
e
- Initialise variable
e
with value of 20e=20
with the help of assignment operator=
- value of variable
e
is divide with 5 and assigned using (/=
) Division Assignment console.log
inbuilt function की मदद्द सेe
variable की value को display किया गया हैं
Program to use Remainder Assignment ( %= ) JavaScript Language
let f = 10;
f %= 3;
console.log('f =',f);
Output
f = 1
Steps Description
- Declare variable
f
- Initialise variable
f
with value of 10f=10
with the help of assignment operator=
- value of variable
f
is Remainder with 3 and assigned using (%=
) Remainder Assignment console.log
inbuilt function की मदद्द सेf
variable की value को display किया गया हैं
Program to use Exponentiation Assignment ( **= ) JavaScript Language
let g = 5;
g **= 3;
console.log('g =',g);
Output
g = 125
Steps Description
- Declare variable
g
- Initialise variable
g
with value of 5g=5
with the help of assignment operator=
- value of variable
g
is Exponentiation with 3 and assigned using (**=
) Exponentiation Assignment console.log
inbuilt function की मदद्द सेg
variable की value को display किया गया हैं