javascript and operator
//AND Operator expressed as &&
const x = 7;
const y = 4;
(x == 7 && y == 5); // false
(x == 3 && y == 4); // false
(x == 7 && y == 4); // true
if (condition == value && condition == otherValue) {
return something;
}
javascript and operator
//AND Operator expressed as &&
const x = 7;
const y = 4;
(x == 7 && y == 5); // false
(x == 3 && y == 4); // false
(x == 7 && y == 4); // true
if (condition == value && condition == otherValue) {
return something;
}
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
How does logical operators && works in javascript?
const num = 6;
if (num <= 7 && num <= 8) {
console.log('true')
} else {
console.log('false')
}
//Expected output:true
operators in javascript
// Javascript Airthmetic Operators
+ : Addition
- : Subtraction
* : Multiplication
** : Exponentiation (ES2016)
/ : Division
% : Modulus (Division Remainder)
++ : Increment
-- : Decrement
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us