Animal Fun Facts

my code is breaking on this exercise on line 9 and I don´t know why, I will appreciate any help. :pray:
thank you,

Here the link:


import { animals } from './animals';
import React from 'react';
import ReactDOM from 'react-dom';

const title = "";
const background = (
  <img className="background" alt="ocean" src="/images/ocean.jpg"/>
const images = [];
for (const animal in animals) {
      key: {animal}
      className: 'animal'
      alt: {animal}
      src: {animals[animal].image}
      aria-label: {animal}
      role: 'button'

const animalFacts = (
    {title === '' ? 'Click an animal for a fun fact' : title}
    <div className='animals'>

ReactDOM.render(animalFacts, document.getElementById('root'));

You are pushing an html element to the array. So you need to apply the html syntax. That means you need to use equal signs rather than colons for the assignment of attributes.


thank you mirja_t ! Yes I just copy pasted that code from that instructions, but it was a bit strange to me.

1 Like