Y its printing the duplicate values for specific (items)

I’m working on one of the project here is my code:
{res.slice(0, c).map((key, value) => (key ?

  • {key.split(’:’)[0]} : {key.split(’:’)[1]}
  • : “”))}

    here the res contains all the attributes … so it’s displaying the attribute as per .slice(0,c) . But for 2-3 items the attribute values are getting repeated. How can I avoid to print the duplicate values.

    Your code so far

    const JSX = <div></div>;
    

    Your browser information:

    User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.115 Safari/537.36

    Challenge: Create a Simple JSX Element

    Link to the challenge: