Quiz: A Lonely Zero

Nobody has picked any favorite bands yet, so the section Your Favorites shouldn't show, and it doesn't. But under the heading Summer Sounds, there's a 0. Click the line with the mistake.

const favorites = [];

export default function App() {
    return (
        <main>
            <h1>Summer Sounds</h1>
            {favorites.length && (
                <section>
                    <h2>Your Favorites</h2>
                    <ul>
                        {favorites.map((name) => (
                            <li key={name}>{name}</li>
                        ))}
                    </ul>
                </section>
            )}
            <p>Pick the bands you don't want to miss.</p>
        </main>
    );
}

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

Back

10/11

Next