๐—จ๐—ป๐—ฑ๐—ฒ๐—ฟ๐˜€๐˜๐—ฎ๐—ป๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿง ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ๐˜€ ๐—ถ๐—ป JS ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ด

Asaduzzaman Hisam
2 min readJust now

--

In programming, operators are symbols that represent operations performed on variables and values. They are essential in executing arithmetic, comparison, logical, assignment, and conditional operations.

Here are some key types of operators commonly used:

๐Ÿญ. ๐—”๐—ฟ๐—ถ๐˜๐—ต๐—บ๐—ฒ๐˜๐—ถ๐—ฐ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ๐˜€: Used for basic mathematical operations like addition (+), subtraction (-), multiplication (*), division (/), modulus (%), increment (++), and decrement ( โ€” ).

๐Ÿฎ. ๐—–๐—ผ๐—บ๐—ฝ๐—ฎ๐—ฟ๐—ถ๐˜€๐—ผ๐—ป ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ๐˜€: Allow comparison between values, such as greater than (>), less than (<), equal to (==), strict equality (===), and not equal to (!=).

๐Ÿฏ. ๐—Ÿ๐—ผ๐—ด๐—ถ๐—ฐ๐—ฎ๐—น/๐—ฅ๐—ฒ๐—น๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ๐˜€: Used for logical operations, including AND (&&), OR (||), and NOT (!).

๐Ÿฐ. ๐—”๐˜€๐˜€๐—ถ๐—ด๐—ป๐—บ๐—ฒ๐—ป๐˜ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ๐˜€: Assign values to variables, like the simple assignment (=), and compound assignments such as +=, -=, *=, /=, and %=.

๐Ÿฑ. ๐—–๐—ผ๐—ป๐—ฑ๐—ถ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น/๐—ง๐—ฒ๐—ฟ๐—ป๐—ฎ๐—ฟ๐˜† ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ: A shorthand for if-else statements, written as โ€œcondition ? expr1 : expr2โ€.

(~)๐—ฆ๐—ฝ๐—ฒ๐—ฐ๐—ถ๐—ฎ๐—น ๐—ก๐—ผ๐˜๐—ฒ๐˜€:-

  • ๐—œ๐—ป๐—ฐ๐—ฟ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ (++) ๐—ฎ๐—ป๐—ฑ ๐——๐—ฒ๐—ฐ๐—ฟ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ( โ€” ) ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ๐˜€: When used before a variable (prefix), they modify the value before using it. When used after a variable (postfix), they modify the value after using it.
  • ๐—ฆ๐˜๐—ฟ๐—ถ๐—ฐ๐˜ ๐˜ƒ๐˜€. ๐—Ÿ๐—ผ๐—ผ๐˜€๐—ฒ ๐—˜๐—พ๐˜‚๐—ฎ๐—น๐—ถ๐˜๐˜†: โ€œ===โ€ checks both value and type, while โ€œ==โ€ only checks value, converting types if necessary.
  • โ€œ๐˜๐˜†๐—ฝ๐—ฒ๐—ผ๐—ณโ€ ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ: A special operator in JavaScript that returns the data type of a variable, such as โ€œstringโ€, โ€œnumberโ€, โ€œobjectโ€ etc. Interestingly, it returns โ€œobjectโ€ for null values.

Understanding these operators is fundamental for efficient programming and debugging. Make sure to use them wisely to maintain clean and effective code. ๐ŸŒŸ

--

--

Asaduzzaman Hisam
Asaduzzaman Hisam

Written by Asaduzzaman Hisam

0 Followers

I'm a learner.

No responses yet