Give Sibling Elements a Unique Key Attribute - is this a bug?

Give Sibling Elements a Unique Key Attribute - is this a bug?
0

#1

Tell us what’s happening:
There is an error in my code but it passes anyway.
(Is it worth reporting as an issue?)

Your code so far



const frontEndFrameworks = [
  'React',
  'Angular',
  'Ember',
  'Knockout',
  'Backbone',
  'Vue'
];

function Frameworks() {
  const renderFrameworks = frontEndFrameworks.map((y,i) => {
    return <li key={i}>y</li>
  })
  return (
    <div>
      <h1>Popular Front End JavaScript Frameworks</h1>
      <ul>
        {renderFrameworks}
      </ul>
    </div>
  );
};

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/67.0.3396.99 Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/give-sibling-elements-a-unique-key-attribute


#2

Yeah it looks like a bug.

It’s always worth reporting them to make exercises more resilient :slight_smile:


#3

@JohnnyBizzel - Definitely, because after looking at the tests, it is only confirming that there are six li elements and that they all have keys. The test does not validate the inner text of the li elements, which is why it did not catch the “y” text in each element.


#4

Ok, I have reported it on GitHub now. :+1: