Ready. Start with one instruction.
Loading the learning workspace…
FROM YOUR FIRST INSTRUCTION TO A WORKING APPLICATION
Learn JavaScript from scratch through small working examples, visual experiments and complete projects. No account or AI key required.
Predict → Experiment → Build → Test → Explain
Ready. Start with one instruction.
Loading the learning workspace…
Logical AND requires both conditions; logical OR accepts either. The ternary operator chooses one of two values using condition ? yes : no. Keep ternary expressions short enough to read aloud. They are not a replacement for every if statement. This example requires both enough credits and confirmation before reporting Ready. A single fulfilled requirement should not grant the whole decision.
const credits = 1;
const confirmed = true;
console.log(credits >= 3 && confirmed ? "Ready" : "Review");Review
AND keeps a confirmed but underqualified case in Review.
const credits = 1;This statement belongs to the operation described above. Compare its names, arguments and current state before advancing.
const confirmed = true;Declare confirmed with const. The binding cannot be reassigned. The expression after = supplies its initial value; = is assignment, not an equality comparison.
console.log(credits >= 3 && confirmed ? "Ready" : "Review");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
const credits = 3;
const confirmed = true;
console.log(credits >= 3 && confirmed ? "Ready" : "Review");Ready
AND keeps a confirmed but underqualified case in Review.
const credits = 3;Declare credits with const. The binding cannot be reassigned. The expression after = supplies its initial value; = is assignment, not an equality comparison.
const confirmed = true;Declare confirmed with const. The binding cannot be reassigned. The expression after = supplies its initial value; = is assignment, not an equality comparison.
console.log(credits >= 3 && confirmed ? "Ready" : "Review");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
const credits = 5;
const confirmed = true;
console.log(credits >= 3 && confirmed ? "Ready" : "Review");Ready
AND keeps a confirmed but underqualified case in Review.
const credits = 5;This statement belongs to the operation described above. Compare its names, arguments and current state before advancing.
const confirmed = true;Declare confirmed with const. The binding cannot be reassigned. The expression after = supplies its initial value; = is assignment, not an equality comparison.
console.log(credits >= 3 && confirmed ? "Ready" : "Review");Evaluate the argument and display its value at this point. Quoted text is literal; an unquoted identifier reads its current binding.
Repair the intentionally changed operation so the example produces the exact expected result. Then try the extension without copying the answer.
const credits = 1; const confirmed = true; console.log(credits >= 3 || confirmed ? "Ready" : "Review");
const credits = 1; const confirmed = true; console.log(credits >= 3 && confirmed ? "Ready" : "Review");
Use AND for combined requirements and OR for independent alternatives.
Which operation changed the result, why did it work, and what would you test next?
Use a different value that could expose a boundary or mistake. Predict the result first, run it, and explain how the concept would help in a small real application.
Related: Previous lesson Next lesson
100 lessons across 20 modules, covering variables, operators, strings, conditions, loops, functions, scope, arrays, objects, DOM, events, state, testing, asynchronous JavaScript and application development.