Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js or

// "or" logical operator in JS: ||

// An example
const John = {age: 19}
const Luke = {age: 17}

if (John.age >= 18 || Luke.age >= 18) console.log('Someone is 18+')
else console.log('No one is 18+')
 
PREVIOUS NEXT
Tagged: #js
ADD COMMENT
Topic
Name
3+4 =