Boolean Expressions Reading assignment

Hello AlexParas,

thank you for your very helpful comments. I fixed my post according to your recommendations.

Regards

Ouzo69

2 Likes
  1. Operators connects the values in Javascript. They can be arithmetic, string operators, comparison, logic etc.
  2. You have the arithmetic, string, logical, comparison.
  3. Logical - II and &&.
1 Like

It was just a cooperative comment from student to student. Again nice homework and glad to see that you correspond and agreed to it.
My best regards

1 Like
  1. Operations are like actions in the code. If you put an operator between two values, it will apply the operator to those values and produce a new value. Operators can be, for example, arithmetic actions, such as multiplying, adding, subtracting or dividing.

  2. Binary operators use two values and include e.g.: +, −, *, / , %, <, >, <=, >=, ==, !=, &&, l l

  3. Logical operators: &&, l l, !

1 Like
  1. What are operators?
    signs used in setting variables, checking value in comparison to another and mathematical operations

  2. What binary operators do you know?

    • – ++ / * %
  1. What logical operators do you know?
    &&, ||, !
1 Like
  1. Operators are symbols that are used with variables to perform certain functions.
    You can think for example of arithmetic functions, such as: addition, subtraction and multiplication.

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

  3. JavaScript supports three logical operators:
    and &&
    or ||
    not !

1 Like
Questions
  1. [spoiler]Operators are the symbols between values that allow different operations like addition, subtraction, multiplication, and more.
    JavaScript has dozens of operators, so let’s focus on the ones you’re likely to see most often.
    [/spoiler]
Operators in details

Arithmetic

The + operator adds two numbers.

EXAMPLE

1 + 2;
OUTPUT
3

The - operator subtracts one number from another.

EXAMPLE

50 - 15;
OUTPUT
35

The * operator multiplies two numbers. Notice it’s an asterisk and not the × symbol commonly used in math.

EXAMPLE

3 * 12;
OUTPUT
36

The / operator divides one number by another. Notice it’s a forward slash and not the ÷ symbol commonly used in math.

EXAMPLE

12 / 4;
OUTPUT
3

JavaScript expressions follow an order of operations, so even though + is written first in the following example, the multiplication happens first between the last two numbers and *.

EXAMPLE

1 + 100 * 5;
OUTPUT
501

If want more control over the order, that’s where the grouping operator comes in handy.

Grouping

() operator groups other values and operations. Code located between parentheses evaluates first as JavaScript solves each operation moving from left to right.
Adding the grouping operator to the previous example causes 1 + 100 to evaluate first.

EXAMPLE

(1 + 100) * 5;
OUTPUT
505

Concatenation

The + operator can also concatenate strings, which is another way of saying it can add them together.

EXAMPLE

"news" + "paper";
OUTPUT
"newspaper"

Assignment

The = operator assigns values. It’s used for setting the value of variables.

EXAMPLE
var dinner = "sushi";

  1. [spoiler] JavaScript has both binary and unary operators, and one special ternary operator, the conditional operator. A binary operator requires two operands, one before the operator and one after the operator:
    [/spoiler] [spoiler]
    operand1 operator operand2
    For example, 3+4 or x*y . [/spoiler]

[spoiler] A unary operator requires a single operand, either before or after the operator:
operator operand
or
operand operator
For example, x++ or ++x .
[/spoiler]

  1. [spoiler] here are three logical operators in JavaScript: || (OR), && (AND), ! (NOT).[/spoiler]
Logical operators

[spoiler]

Operator Syntax Description
Logical AND ( && ) expr1 && expr2 If expr1 can be converted to true , returns expr2 ; else, returns expr1 .
Logical OR ( || ) expr1 || expr2 If expr1 can be converted to true , returns expr1 ; else, returns expr2 .
Logical NOT ( ! ) !expr Returns false if its single operand can be converted to true ; otherwise, returns true .

[/spoiler]

Bonus info

[spoiler]In modern code you can use the new Nullish coalescing operator ( ?? ) that works like || , but it only returns the second expression, when the first one is nullish, i.e. null or undefined. It is thus the better alternative to provide defaults, when values like '' or 0 are valid values for the first expression, too.[/spoiler]

1 Like

Operators are symbols that tell the program what to do with various values within the program to accomplish a certain function. For exapmle +, -, ect.

That are operators that use 2 values.
Binary operators for JS Arithmatic operators (+, -, *, /, and %), string concatenation (+), comparison (==, !=, ===, !==, <, >, <=, >=)

Logical operators are used to determine the logic between variables or values.
&& (and), ||(or), !(not)

1 Like

Thank you for contributing & helping our community. :hugs:We need more active people like you in the forum, we appreciate it very much.:raised_hands:
keep it up!

Ivo

1 Like

Wow, I didn’t see the arrows at first, and I was like “booorriiiii”, but then I saw the arrows and I got my mind blown away! :speak_no_evil: :hear_no_evil:

Nice touch with the examples etc, etc… and the answers of course. :roll_eyes:

Ivo

1 Like

Glenn_CostaRica

1. What are operators?
Operators are sets of instructions that execute some work on the values of one or more variables. In reality, operators are functions, but, as programmers, we interact with them as simple symbols like !, +, or * (not, addition or multiplication).

2. What binary operators do you know?
==, ===, !=, !==, <, >, <=, >=, &&, ||, +, -, *, /, ^ , % …

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

1 Like

1. What are operators?
Operators compare a value and return true or false.

2. What binary operators do you know?
> greater than
< less than
== equal to
<= less than or equal to
>= more than or equal to
!= not equal to

3. What logical operators do you know?
&& and
|| or
? conditional

1 Like
  1. Operators transform the input value/s into output/s
  2. <, >, ==, >=, <=, !=, +, -, *, /, %
  3. &&, ||, !
1 Like
  1. What are operators? perform operation on data values to produce results
  2. What binary operators do you know? <, >, ==, !=
  3. What logical operators do you know?&&,II
1 Like
  1. Operators are functions which manipulates data sets. Ex 1+2. The 1 and 2 is the data and the “+” is the operator which manipulates them in the output.
    2)Binary Operators are <, >, ==
  2. Logical Operators are && || !
1 Like
  1. What are operators?
    Operators combine and transform values in Javascript.
  2. What binary operators do you know? +, *, -, /, zeros/ones, true/false, yes/no, weak/strong, on/off
  3. What logical operators do you know? &&, ||, !, and, or, not
1 Like

1. What are operators?
Binary and Unary operators exist. Binary operators take two values, Unary operators take a single value. Operator carry out some action on the values they are given.
2. What binary operators do you know?
Arithmetic operations would be binary operators, such as, add, minus, divide, multiply. Boolean operators like, greater than, less than, ==, !==, are also binary operators.
3. What logical operators do you know?
Logical operator would be, and, or, not, and used with 2 values return boolean result.

1 Like
  1. What are operators?
    Operators can be symbols of words that assign value to variables are generate outcomes
  2. What binary operators do you know?
    Binary operators use two values and examples are for arithmetic such as +, -, *, / or comparisons such as < and >, <= or ==
  3. What logical operators do you know?
    Three operators which are ‘and’ && or (||) and not (!)
1 Like
1. What are operators?
Operators conduct operations / actions such as arithmetic (+ - * /) on values to evaluate expressions and solve problems.

2. What binary operators do you know?
"yes" or "no", "on" or "off", "true" or "false"

3. What logical operators do you know?
and = &&, or = ||, not = !=
1 Like
  1. Operators are values that are used to solve mathematical problems for example: +, -, *, /

  2. Binary operators are operators that take two values. Binary operators are presented in this form: Operand1 Operator Operand2 (4 > 3, 4 + 5 etc). Commonly used operators are ==, !=, <, >, <=, >=, +, -, *, /, &&, ||, %.

The operator “&&” represents logical and if the two operands are true then the output will be true.

The operator “||” represents logical or if one operand is true then the output will be true.

The unary operator “!” Not that changes true to false and false to true.

The ternary operator(which is the only ternary operator in the language) for example console.log(true ? 3 : 4); if true is typed then the value in the center gets “picked” and if false is typed the value on the right gets “picked”.

1 Like