Hi @Nev,
Your answers are mainly OK…
Just a couple of comments…
Operators perform different kinds of actions on values.
&& (YES)
|| (YES)
== (NO, this is a comparison operator)
Hi @Nev,
Your answers are mainly OK…
Just a couple of comments…
Operators perform different kinds of actions on values.
&& (YES)
|| (YES)
== (NO, this is a comparison operator)
Hi @CeesQ,
Just to confirm…operators perform specific actions on values. Not only mathematical and logical operations, but other actions as well.
Hi @Matgas,
Just to clarify a couple of things…
Yes, that’s correct… but operators perform many other types of actions on values as well.
Yes, these are logical operators.
No, these are comparison operators…
…except for =
which is an assignment operator.
Hi @Pacheco,
Nice answers
In your answer to Q2, I’m not sure what you mean by…
…could you explain which specific binary operators you mean here?
This is artwork! Great Job!
Hi @babie,
Q1 & 3
No…
Examples of binary operators are:
+ - * // mathematical operators
> < >= // comparison operators
Hi @Kieran,
Nice answers
Just a couple of comments…
Yes, that’s correct…
… and what is also key about operators is that they perform these actions on values.
Just to clarify…
=
doesn’t signify equals in JavaScript. As you have said, it is an assignment operator, and assigns a value to a variable name.
==
signifies equal to (in value)
===
signifies equal to (in both value and type)
Hi @FrankB,
Interesting answers! You certainly know a lot more than me in terms of the mathematical theory behind the concept of operators.
In terms of JavaScript, the exponentiation operator is **
(two asterisks) and produces the same result as the Math.pow(x, y)
function that you mentioned.
In JavaScript, the caret symbol ^
represents the Bitwise XOR operator.
Yes
In JavaScript this is classed as a comparison operator (not a logical operator)
In JavaScript this would still essentially be a Boolean expression based on logical OR, and would evaluate as in the following example:
!true || 6 < 7 => false || true // => true
!true || 6 > 7 => false || false // => false
I understand your point—the definitions that I provided are the standard formal logic definitions. Thank you so much for taking the time to reply…
Thanks - I appreciate the clarifications!
Lol, I don’t know why did I wrote that, anyway I edited my post with the right answer. Thanks again!
Operators perform some assigned action to the operands: 1 + 2;
1 is the left operand, + is the operator and 2 would be the right operand
+, -, *, /, %, ++ and –
And, Or, Not (&&, ||, !)
Boolean Expressions Reading Assignment.
What are operators?
What binary operators do you know?
These are some of the binary operators i know:
What logical operators do you know?
JavaScript supports three logical operators: "and" which looks like is as an operator &&, "or" as an operator looks like this ll and not looks like this as an operator !. Not is a unary operator that flips the value given to it.
Operators are the text or symbols used to perform certain operations, such as + for addition operations or - for subtractions operations,
+, -, *, /, %, <, >, =
and (&&) , or(||) , and not (!=)
Operators are just operations that the program must complete when instructed such as add or subtract.
A Binary operator is an operation that has two outcomes i.e true or false and yes or no.
Logical operators or Tertiary operators have more then two possibilities of the outcome.
Thank you for that feedback. You make learning easy
An Operator performs an action on a given value or values and returns a result
A Binary Operator performs an action on two values. Some examples of binary operators are +, /. *, + In practise a binary operator would be used like this 5+7 and it would return a value of 12.
A Logical Operator returns either a true value or a false value. Common examples of Logical Operators are &&, ||,! Where && represents AND, ||, represents OR and ! represents NOT
Yes, that was an error. Thanks for catching!
Hi @umeshusoda,
Yes… except for the increment operator ( ++
) and the decrement operator ( --
)
These are actually unary operators ( not binary operators) because they only operate on one value (adding or subtracting 1 to/from it) rather than on two values.
Hi @Hamze_Dirir,
Excellent examples of binary and logical operators
This is only one of the many actions that operators perform on values. As you have rightly gone on to say, operators can also perform mathematical, logical and comparative operations. Generally speaking we can say that operators perform actions on values.