Logical OR in JavaScript

The || operator is a logical OR and requires at least one condition to be met.

In the following example, if the variable num1 is greater than 0 or the variable num2 is greater than 0, then the condition will be true (it is enough at least one of the conditions to be met):

javascriptlet num1 = 10;
let num2 = -5;

if (num1 > 0 || num2 > 0) {
  console.log('+++'); // it will work
} else {
  console.log('---');
}
Задание 1

Without running the code, determine what will be output to the console:

javascriptlet num1 = -10;
let num2 = -10;

if (num1 >= 0 || num2 >= 0) {
  console.log('+++');
} else {
  console.log('---');
}
Задание 2

Without running the code, determine what will be output to the console:

javascriptlet num1 = 0;
let num2 = 0;

if (num1 >= 0 || num2 >= 0) {
  console.log('+++');
} else {
  console.log('---');
}
Задание 3

Without running the code, determine what will be output to the console:

javascriptlet num1 = 0;
let num2 = 5;

if (num1 >= 0 || num2 >= 0) {
  console.log('+++');
} else {
  console.log('---');
}
Задание 4

Without running the code, determine what will be output to the console:

javascriptlet num1 = 5;
let num2 = 5;

if (num1 >= 0 || num2 >= 0) {
  console.log('+++');
} else {
  console.log('---');
}
Задание 5

Without running the code, determine what will be output to the console:

javascriptlet num1 = -5;
let num2 = 15;

if (num1 >= 0 || num2 >= 0) {
  console.log('+++');
} else {
  console.log('---');
}
Задание 6

Without running the code, determine what will be output to the console:

javascriptlet num = 1;

if (num == 0 || num == 1) {
  console.log('+++');
} else {
  console.log('---');
}
Задание 7

Without running the code, determine what will be output to the console:

javascriptlet num = 2;

if (num == 0 || num == 1) {
  console.log('+++');
} else {
  console.log('---');
}
Задание 8

Without running the code, determine what will be output to the console:

javascriptlet num = 2;

if (num == 0 || num == 1 || num == 2) {
  console.log('+++');
} else {
  console.log('---');
}