जावास्क्रिप्ट में लॉजिकल OR

ऑपरेटर || लॉजिकल OR का प्रतिनिधित्व करता है और कम से कम एक शर्त के पूरा होने की आवश्यकता होती है।

निम्नलिखित उदाहरण में, यदि चर num1 0 से अधिक है या चर num2 0 से अधिक है, तो शर्त सत्य होगी (कम से कम एक शर्त के पूरी होने पर भी):

javascriptlet num1 = 10;
let num2 = -5;

if (num1 > 0 || num2 > 0) {
  console.log('+++'); // यह काम करेगा
} else {
  console.log('---');
}
Задание 1

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

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

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

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

javascriptlet num1 = 0;
let num2 = 0;

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

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

javascriptlet num1 = 0;
let num2 = 5;

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

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

javascriptlet num1 = 5;
let num2 = 5;

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

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

javascriptlet num1 = -5;
let num2 = 15;

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

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

javascriptlet num = 1;

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

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

javascriptlet num = 2;

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

कोड चलाए बिना निर्धारित करें कि कंसोल में क्या प्रिंट होगा:

javascriptlet num = 2;

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