Complete the code to create a reactive object in Vue.
const state = reactive({ count: [1] })We start the count at 0 to track changes reactively.
Complete the code to watch a reactive property in Vue.
watch(() => state.count, (newVal, oldVal) => { console.log([1]) })We log the new value whenever the count changes.
Fix the error in the code to update a nested reactive property correctly.
state.user.name = [1]Strings must be wrapped in quotes to assign properly.
Fill both blanks to create a computed property that doubles a reactive count.
const doubleCount = computed(() => state.count [1] 2 [2] 0 )
We multiply count by 2, then add 0 (which is optional but here for syntax).
Fill all three blanks to create a reactive object with a nested reactive array and update it.
const state = reactive({ items: [1] })
state.items.push([2])
console.log(state.items[[3]])We start with an empty array, push a string, then log the first item at index 0.
