Question · Vue.js course · Module 4: Computed & Watch

Default invocation of watch vs watchEffect

How do watch and watchEffect differ in when their callback first runs?

Answer options

  • watch is lazy by default (runs only on change), while watchEffect runs the callback immediately on creation
  • Both run immediately on creation
  • Both are lazy and wait for the first dependency change
  • watchEffect is lazy, while watch runs immediately

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