What two values can a JavaScript Boolean have?
A Boolean has exactly two values: `true` and `false`.
Study 3 Conditionals and Boolean Logic with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What two values can a JavaScript Boolean have?
A Boolean has exactly two values: `true` and `false`.
Which JavaScript values are commonly falsy?
Common falsy values include `false`, `0`, `""`, `null`, `undefined`, and `NaN`. Empty arrays and objects are truthy.
Why prefer `===` and `!==` in JavaScript?
Use `===` for strict equality and `!==` for strict inequality. They do not automatically convert one type into another.
What ordering does JavaScript use when comparing strings?
JavaScript compares strings according to Unicode ordering, which may not match dictionary order in every language.
When is `&&` true?
The `&&` operator is true only when both conditions are true. Use it when all requirements must be satisfied.
When is `||` true?
The `||` operator is true when at least one condition is true. Use it when any acceptable alternative is sufficient.
What does the `!` operator do?
The `!` operator reverses a Boolean value: `!true` is `false`, and `!false` is `true`.
How does JavaScript short-circuit logical expressions?
With `&&`, a falsy left operand skips the right side; with `||`, a truthy left operand skips the right side.
How does `??` differ from `||` for default values?
`??` uses the fallback only for `null` or `undefined`, whereas `||` uses it for every falsy value, including `0` and `""`.
What does an `if...else` statement choose?
An `if...else` statement runs the `if` block when its condition is truthy; otherwise, it runs the `else` block.
How are `else if` branches evaluated?
JavaScript tests an `else if` chain from top to bottom and runs only the first truthy branch. Put more specific or higher-priority tests first.
When is the ternary operator appropriate?
The ternary form is `condition ? valueIfTrue : valueIfFalse`. Use it for a short two-way value choice; use `if...else` for multiple actions.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.