Note: This is a short warm-up question meant to help you familiarize yourself with the coding workspace. Actual UI coding interview questions will be more complicated.
Make the text within the button display the number of times the button has been clicked.
This is a short question that only requires one state variable: the number of times the button has been clicked (count).
Declare count as a variable. Attach a callback to the <button>'s on:click handler and increment the count value within it. count will now be incremented whenever the <button> is clicked.
<!doctype html><html><head><meta charset="utf8" /><meta name="viewport" content="width=device-width" /><title>Svelte</title><link rel="stylesheet" href="public/bundle.css" /></head><body><script src="bundle.js"></script></body></html>
console.log() statements will appear here.