Complete the code to import the writable function from Svelte.
import { [1] } from 'svelte/store';
The writable function is used to create writable stores in Svelte.
Complete the code to create a writable store with initial value 0.
const count = [1](0);
Use writable(0) to create a store starting at 0 that you can update.
Fix the error in the code to update the writable store value.
count.[1](n => n + 1);
The update method lets you change the store value based on the current value.
Fill both blanks to subscribe to the store and log its value.
const unsubscribe = count.[1](value => { console.[2](value); });
Use subscribe to listen to store changes and console.log to print the value.
Fill all three blanks to create a writable store, update it, and set a new value.
import { [1] } from 'svelte/store'; const score = [2](10); score.[3](20);
Import writable, create the store with writable(10), then use set(20) to change the value.
