Astro is a modern web framework. What is its main goal?
Think about what makes websites load faster and use less code on the client side.
Astro focuses on delivering minimal JavaScript to browsers, improving website speed and performance.
In Astro, what happens to components when the page loads in the browser?
Consider how Astro optimizes for speed by default.
Astro renders components to static HTML by default, sending no JavaScript to the browser unless you add client-side interactivity.
Which of the following is the correct way to define a simple Astro component that displays a greeting?
Astro uses frontmatter with triple dashes for scripts and plain HTML for markup.
Astro components use frontmatter (---) for scripts and then HTML markup. Option C shows this pattern correctly.
Given this Astro component code, what is the rendered output?
--- const count = 3; --- <p>Count is {count}</p>
Variables inside curly braces in Astro markup get replaced with their values.
The variable count is 3, so the output replaces {count} with 3.
Look at this Astro component code. Why does it cause an error?
---
const message = 'Hi there'
---
<h1>{message}</h1>Check the JavaScript syntax inside the frontmatter block.
JavaScript inside frontmatter requires proper syntax, including semicolons. Missing semicolon can cause parsing errors.
