Skip to main content

How to get the current value of a signal?

The current value of a signal is obtained by calling it as a function:

ts
const value = counter();

If counter = signal(0), then counter() returns 0.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.