Complete the code to add a debug statement that logs the variable count.
<script> let count = 0; {@debug [1] </script>
The {@debug} tag in Svelte logs the value of the variable you pass to it. You just need to put the variable name count inside the braces.
Complete the code to debug both name and age variables together.
<script> let name = 'Alice'; let age = 30; {@debug [1] </script>
To debug multiple variables in Svelte, you pass an object with those variables inside {@debug}, like {@debug {name, age}}.
Fix the error in the debug statement that tries to log user but is missing braces.
<script>
let user = { name: 'Bob' };
{@debug [1]
</script>When debugging an object in Svelte, you must wrap it in braces inside {@debug} to log its properties properly, like {@debug {user}}.
Fill both blanks to debug score and level variables as an object.
<script> let score = 100; let level = 2; {@debug [1] {@debug [2] </script>
The first debug logs both variables as an object {@debug {score, level}}. The second debug logs just the score variable.
Fill all three blanks to debug userName, userAge, and isLoggedIn together as an object.
<script> let userName = 'Eve'; let userAge = 25; let isLoggedIn = true; {@debug [1] {@debug [2] {@debug [3] </script>
The first debug logs all three variables as an object. The second logs just userName. The third logs isLoggedIn.