Boolean Expressions Reading assignment

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)

1 Like

Hi @CeesQ,

Just to confirm…operators perform specific actions on values. Not only mathematical and logical operations, but other actions as well.

1 Like

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.

1 Like

Hi @Pacheco,

Nice answers :ok_hand:

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!

2 Likes

Hi @babie,

Q1 & 3 :ok_hand:

No…
Examples of binary operators are:

+   -   *     // mathematical operators
>   <   >=    // comparison operators
1 Like

Hi @Kieran,

Nice answers :ok_hand:

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)

3 Likes

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 :+1:

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
1 Like

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…

1 Like

Thanks - I appreciate the clarifications!

1 Like

Lol, I don’t know why did I wrote that, anyway I edited my post with the right answer. Thanks again!

1 Like
  1. 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

  2. +, -, *, /, %, ++ and –

  3. And, Or, Not (&&, ||, !)

1 Like

Boolean Expressions Reading Assignment.

What are operators?

  1. In JavaScript an operators assigns value to a variable. What this means when using any of these in JavaScript + - * / = like in maths, you are asking two properties (values) to either + /*- from one another. Operators can not only perform maths but logical and comparison are other form of operators. Logical operators would look like this, ll,&& and !. Comparison <,> ==, !=.

What binary operators do you know?

These are some of the binary operators i know:

  1. +, -, *, /, %, <, >, <=, >=, ==, !=, ===, !==, && and ||

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.

1 Like

Operators are the text or symbols used to perform certain operations, such as + for addition operations or - for subtractions operations,

+, -, *, /, %, <, >, =

and (&&) , or(||) , and not (!=)

1 Like
  1. Operators are just operations that the program must complete when instructed such as add or subtract.

  2. A Binary operator is an operation that has two outcomes i.e true or false and yes or no.

  3. Logical operators or Tertiary operators have more then two possibilities of the outcome.

Thank you for that feedback. You make learning easy

1 Like

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

1 Like

Yes, that was an error. Thanks for catching!

1 Like

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.

1 Like

Hi @Hamze_Dirir,

Excellent examples of binary and logical operators :+1:

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.

1 Like