Chapter quiz · Control Flow

Test what you learned.

8 questions on Control Flow. Pass 70% to clear the chapter.

← Review chapter lessons

Quiz

Control Flow — Chapter Quiz

Eight questions on comparisons, conditionals, and loops.

0/ 8
  1. Question 1
    1

    What does this code log?

    console.log(0 == false);
    
  2. Question 2
    2

    Which operator falls back **only** when the value is null or undefined?

  3. Question 3
    3

    What does this code log?

    const user = null;
    console.log(user?.name ?? "guest");
    
  4. Question 4
    4

    Inside a forEach callback, what does break do?

  5. Question 5
    5

    Which loop iterates the **values** of an array, string, set, or map?

  6. Question 6
    6

    A switch block needs break after every case — forgetting it lets execution fall through to the next case.

  7. Question 7
    7

    What does this code log?

    const numbers = [3, 7, 12, 4];
    for (const n of numbers) {
      if (n > 10) {
        console.log(n);
        break;
      }
    }
    
  8. Question 8
    8

    To safely read user.address.city when user or address might be missing, use user_____.city.

Pick an answer — instant feedback as you go.