Angular · Junior · Question 40 of 75
What does effect() do?
- ✓Correct answer: Runs a function whenever the signals it reads change - for side effects like logging or syncing to
localStorage - 2Creates a derived value that can be used in the template
- 3Animates elements when they enter the DOM
Explanation
Effects run at least once and then whenever their dependencies change. They are for side effects; derived values should use computed().