Boolean Expressions Reading assignment

  1. What are operators?
    Operators are action-oriented / transformative characters that do something with values.

  2. What binary operators do you know?
    |+|Addition|
    |—|---|
    |-|Subtraction|
    |*|Multiplication|
    |**|Exponentiation|
    |/|Division|
    |%|Modulus (Division Remainder)|
    |++|Increment|
    |–|Decrement|
    |==|Equal to|
    |!=|Not Equal to|
    |>|Greater than|
    |<|Less than|
    |>=|Greater or equal than|
    |<=|Less or equal than|

  3. What logical operators do you know?
    && (and), || (or), ! (not)
    Logical operators compare values and evaluate to true or false. For instance if x = 4 and y = 6 then: (x < 10 && y > 1) is true. (x == 5 || y == 5) is false. !(x == y) is true.

1 Like
  1. What are operators?

Operators do an “operation” to two or more values. For example they can do maths operations between to or more values: 5 + 9; 7 - 2 etc… In this case the “+” and “-” sign are the operators, operating between two values (5 and 9, and 7 and 2) They can also be comparative operators that compare two values to another: 4 < 7; or 13 = 4 + 9. Here the “<” and “=” signs are the operators (note that in the 13 = 4 + 9 equation there is another operator - “+”).

  1. What binary operators do you know?
  • , - , * , / , < , > , <= , >= , = , != , %
  1. What logical operators do you know?

a. && (and)
b. II (or)
c. ! (not)
d. ? : (conditional/ternary)

1 Like
  1. Operators are symbols to evaluate an expression within the program.

  2. +,-,*,/,%,<,>,<=,>=,==,===,!=,!==

  3. &&,||,!

1 Like
  1. JavaScript operators are symbols that operate on values that are associated.
  2. +, -, * , /, %, <, >, =, &&, ||, !
  3. &&, ||, !
1 Like

Hi @Travis!
Nice answers :ok_hand:

You’re right, but just to add… operators can also perform an action on just one value. These are the unary operators, for example the NOT operator !  is also a unary operator as well as a logical operator — you’ll learn about some more of them later in the course (e.g. ++ and --).

2 Likes

Hi @Bifin!

Questions 1 and 3 :ok_hand:

Just to check that you understand what the binary operators are:
true and false are not operators, they are Boolean values (a type of value); but
OR || is a logical operator and a binary operator because it performs an action on two values (true and false in your example).

Other examples of binary operators are:

(i) Arithmetic operators
*  multiplied by
/  divided by
%  remainder
+  add
-  subtract

(ii) Comparison operators
>  greater than
<  less than
>=  greater than or equal to
<=  less than or equal to
==  equal to (in value)
!=  not equal to (in value)

1 Like

Hi @Kingsman! Great answers :+1:

I’m sure this was just a copy/paste error, but just to confirm that the decrement operator is 2 minus signs -- and not a single dash –

1 Like
  1. Operators are symbols that combine values to interact with one another, creating an expression that outputs an absolute value.
    2 Binary operators are operators that combine or compare two or more values. A few examples are add (+), subtract (-), multiply (*) and divide (/).
  2. Logical operators are operators that can be applied to Boolean values such as and (&&), or (||), not (!).
1 Like

Hi @Emmerich!

Some really nice detail here :+1:

Just a couple of observations, to help you go even deeper…

In actual fact = is not a comparative operator, but an assignment operator. It doesn’t compare, it assigns e.g.  let myVariable = 4 + 9;
Correctly written, your example of a comparative operator should be:

13 == 4 + 9    // equal to (in value) operator
// or
13 === 4 + 9   // strict equality / identical (both value AND type) operator  
1 Like

NIce! :ok_hand:

By the way…

… the NOT operator ! is actually a unary operator, as well as a logical operator (it’s not a binary operator). Unary operators perform an action on just one value (which can also be an expression). You’ll learn about some more of them later in the course (e.g. ++ and -- ).

2 Likes

Nice answers @AF90! :ok_hand:
I can see you’ve put a lot of thought into the concepts :+1:
Just one thing to clarify…

… only two values (before and after). There is also something called a ternary operator that performs an action on 3 values. Look it up if you haven’t heard of it… it’s pretty cool :sunglasses:

2 Likes

Haha yeah, not sure how I got to that. I think I was a little tired after taking in all the info in chapter 1 and rushed these answers.

1 Like
  1. What are operators?

An operator is a symbol or symbols that direct the console to execute a defined function.

  1. What binary operators do you know?

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

  1. What logical operators do you know?

||, &&, !,

1 Like
  1. What are operators? Basically signs of operations between values
  2. What binary operators do you know? Yes/No, True/False, On/Off
  3. What logical operators do you know? And, Or, Not
1 Like
  1. What are operators?
    Operators are what allow us to manipulate values.

  2. What binary operators do you know?
    <, >, +, -, =<, =>, ==

  3. What logical operators do you know?
    and, or, not
    && , ||, !

1 Like
1. What are operators?

An operator performs one type of operation on single or multiple data inputs and produces an output.

2. What binary operators do you know?

Binary operators produces a result when comparing two data inputs. Some examples:
+, -, *, /, %, ==, !=, ===, !==, <, >, <=, >=, &&, ||

3. What logical operators do you know?
  • unary logical operators : (!x) - not
  • binary logical operators : (x && y) - and; (x || y) - or
  • ternary logical operators: (x ? y : z) - conditional
1 Like
  1. operators are symbols eg + - <> used to manipulate values

  2. <, >, =, >=, <=, !=, ==.

  3. &&, ||, !

1 Like
  1. What are operators?

An operater is an action object that executes a functions on value. Eg. +,-,/,*,%,= etc

  1. What binary operators do you know?

<> ±, Binary operators are sets of two opposing fucntions.

  1. What logical operators do you know?

&& and, or || , not!

1 Like

1 What are operators?

An operator (by performing some operation) is giving data value’s a output (result). Arithmetic operators for example operates on numbers.

2 What binary operators do you know?

It is an operator that perform an operation with two operands. For example a+b (operand) a (operator) + (operand) b

3 What logical operators do you know?

||;&&;!

1 Like

1. What are operators?

Operators are used in order to take written values and computate new values from them.

2. What binary operators do you know?

+, >, <, *, /,%,

3. What logical operators do you know?

&& || !

example:

true && true = true
true || false = true
!false = true

1 Like