Question · Vibe coding with Claude Code course · Module 4: Instagram clone

Quiz: preventDefault in the Form

Why does the comment form's handleSubmit start with event.preventDefault()?

Answer options

  • To clear the comments array
  • So the browser does not reload the page after the form is submitted
  • To close the preview window
  • To increase the like count

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