Complete the code to get a context value inside a Svelte component.
import { getContext } from 'svelte'; const value = getContext([1]);
In Svelte, getContext takes a key string to retrieve the context value.
Complete the code to import the correct function to retrieve context in Svelte.
import { [1] } from 'svelte';
The getContext function is imported from 'svelte' to access context values.
Fix the error in this code that tries to get context but uses the wrong key.
const theme = getContext([1]);The key must be a string matching exactly the one used in setContext, including case.
Fill both blanks to get a context value and log it in a Svelte component.
import { [1] } from 'svelte'; const data = [2]('userData'); console.log(data);
You import getContext and call it with the key string to retrieve context.
Fill all three blanks to get a context value and use it in a reactive statement.
import { [1] } from 'svelte'; const count = [2]('countKey'); $: doubled = count [3] 2;
Import and call getContext to get the value, then multiply it by 2 reactively.