In svelte, how to `console.log('yes')` when a variable changed?

I asked in Twitter, the answer is:

Screenshot of a twitter thread, see link below.

Link to the thread:

I have recently been playing with svelte and needed to call a function when a property changed.
In Vue you would do it with watch, but I could not find an equivilent in Svelte.
In my project have done it like this:

let c = 0;
$: if (c) {

I am not 100% sure if this is the correct way or not though.
Hopefully Rich Harris will chime in here as I would like to know.