Question · JavaScript and React course · Module 15: Patterns and Architecture

State Machine Advantages

What is the main advantage of using a state machine instead of multiple boolean variables?

Answer options

  • React renders faster when using a state machine instead of useState
  • It eliminates impossible states: the application is always in one of clearly defined states
  • A state machine automatically synchronizes state with the database
  • A state machine is faster because it uses less memory

You can check the correct answer by solving this task in the CodeWorlds game.