Ajay Yadav Profile picture
β€’ Technical Writer @Talent_500 β€’ No-Code AI Tools β€’ Mission on Simplified Web β€’ See my passion on YT πŸ’š β€’ DM for collab or mail πŸ“©: partnership.aj@gmail.com

Mar 11, 2022, 14 tweets

πŸ’› Day 1️⃣1️⃣ / 3️⃣0️⃣ days of basics in JavaScript series

β†’ Arithmetic operator?

β†’ Prefix & Postfix operator?

β†’ Assignment operator?

β†’ Comparision operator?

β†’ == VS === operator?

β†’ Logical operator?

β†’ String operator?

#javascript30

Let me explain!πŸ§΅πŸ‘‡

πŸ“Œ Arithmetic operator?

β†’ It is used to perform mathematical calculations.

πŸ‘€ +, -, %, *, **, etc

β†’ ** is a square operator or power operator.

πŸ‘€ 2**3 = 2x2x2

β†’ % is a modulus operator, not a percentage.

β†’ It is used to find the remainder of an expression.

πŸ‘€ 11 % 10 = remainder ( 1 )

πŸ“Œ Prefix & Postfix operator?

β†’ One special operator is an increment or decrement operator in any programming language.

β†’ There are 2 types of increment or decrement operators.

1️⃣ Prefix
2️⃣ Postfix

πŸ“Œ Pre means Before (like prepaid)
πŸ“Œ Post means After (like postpaid)

1️⃣ Prefix: Prefix increment or decrement the value and returns a "new" value.

2️⃣ Postfix: Postfix increment or decrement the value and returns an "old" value.

β›” This operator only applied to variables, not on values!!!

πŸ“Œ Assignment operator?

β†’ It is used to assign value to a variable.

πŸ‘€ =, +=, -=, *=, **=, etc.

β†’ "+=" This operator activates at the same time.

πŸ‘€ c *= 10??πŸ‘‡

πŸ“Œ Comparision operator?

β†’ This operator compares 2 values and returns a boolean value.

β†’ true and false are boolean values.

πŸ“Œ == VS === operator?

β†’ In javascript, there are 2 types of equality operators.

1️⃣ Loose equality operator ( == )

β†’ When we compare between 2 values then the "data types" of that variables are not considered.

β›”In short: only data is compared with loose equality operators.

2️⃣ Strict equality operator ( === )

β†’ When we compare between 2 values then the "data types" of that variables are also considered.

β›” In short: data and data types both are compared with strict equality operators.

πŸ“Œ Logical operator?

β†’ It's used to perform logical operations & return a boolean value.

β†’ && (AND) : true when both values are true.
β†’ || (OR): true when both or only one value are true.
β†’ ! (NOT): if true then false or vice-versa.

β›” More about in the upcoming thread!

πŸ“Œ String operator?

β†’ You can use the + operator to add 2 or more strings.

β†’ Its also known as concatenation.

β†’ Or you can also use the addition assignment( +=) operator for adding the strings.

πŸ“ŒAccess previous threads from this Twitter moment.

twitter.com/i/moment_maker…

πŸ’š That's all for now, we will meet in the next thread!

But if you like make sure to:

1. Follow me @ATechAjay

2. Retweet the first tweet.

3. Turn on the notification to never miss these amazing tweets.

Thank you so much for staying to the end of this thread.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling