π 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.