Complete the code to import the correct function for watching reactive data.
import { [1] } from 'vue';
The watch function is used to watch reactive data changes in Vue.
Complete the code to watch the reactive variable 'count' and log its new value.
watch(count, (newVal, oldVal) => { console.log([1]); });The callback receives the new value as the first argument, which we log.
Fix the error in the watchEffect usage to correctly log the reactive 'message'.
watchEffect(() => { console.log([1]); });When watching a ref inside watchEffect, you must access its value with .value.
Fill both blanks to create a watch that triggers only when 'user.name' changes and logs the new name.
watch(() => user[1]name, (newName) => { console.log(newName[2]); });
The first blank needs a dot to access the property. The second blank uses parentheses to call the function console.log.
Fill all three blanks to create a watchEffect that updates 'fullName' by combining 'firstName' and 'lastName'.
watchEffect(() => { fullName.value = [1] + ' ' + [2]; [3] });.value.Access the values of firstName and lastName refs with .value. Then log the updated fullName.