Answers for "javascript ||"

8

javascript ||

// || means or
Posted by: Guest on October-06-2020
4

not operator js

let a = true;

let b = !a;

console.log(b); //output: false
Posted by: Guest on July-11-2020
1

|| in js

const a = 3;
const b = -2;

console.log(a > 0 || b > 0);
// expected output: true
Posted by: Guest on October-19-2020
0

and javascript

let a = 1;
let b = -1;

if (a > 0 & b > 0){
	console.log("and");
} else if (a > 0 || b > 0){
	console.log("or");
}
Posted by: Guest on March-26-2020
0

or operator js

//OR Operator 

const x = 7;
const y = 4;

(x == 5 || y == 5); // false 
(x == 7 || y == 0); // true
(x == 0 || y == 4); // true
(x == 7 || y == 4); // true
Posted by: Guest on September-26-2020
2

and operator in javascript

//&& returns true if both values are true
//or returns the second argument if the first is true
var a = true
var b = ""
var c = 1

true && "" //""
"" && 1 //""
false && 5 //false
Posted by: Guest on May-20-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language