scrimba
Learn Basic JavaScript
Use the Conditional (Ternary) Operator
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Use the Conditional (Ternary) Operator
AboutCommentsNotes
Use the Conditional (Ternary) Operator
Expand for more info
index.js
run
preview
console
// condition ? statement-if-true : statement-if-false;

function checkEqual(a, b) {
if(a === b) {
return true;
}
else {
return false;
}
}

checkEqual(1, 2);
Console
11
,
index.html
-1:24