Frontend Development ยท React
How would you answer an interview scenario involving state and useState in React?
For a counter updated rapidly from multiple events, use setCount(previous => previous + 1) so each update is based on the latest state rather than a captured value.