• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Quiz

Test your knowledge of conditional statements in JavaScript by answering the following questions.

Questions

  1. What does the statement if (fig==1) do?

    1. Assigns the variable fig the value 1.

    2. Displays an error message because the names of fruits cannot be used as variable names.

    3. Checks fig for a value of 1 and performs an action if it matches.

  2. What does the switch statement do?

    1. Tests a variable for a number of different values.

    2. Turns a variable on or off.

    3. Makes ordinary if statements longer and more confusing.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint