skip to Main Content

Json – Typescript Merge Array of Items

I have this type of array in the angular 14 [ { "parentItem": "WBP258R", "childItem": "WBP258R", "columnName": "Color", "oldValue": "Rainbow", "newValue": "Rainbow1" }, { "parentItem": "WBP258R", "childItem": "WBP258R", "columnName": "Pg #", "oldValue": "4", "newValue": "44" }, { "parentItem": "WBP258R", "childItem":…

VIEW QUESTION

Reactjs – This should prevent duplicate items in my list, but it doesnt. Any idea why?

export default function Track({ data, setPlaylist, playlist }) { function handleAdd(song) { console.log(song.id); if (!playlist === song) { setPlaylist((playlist) => [...playlist, song]); } } return ( <div className="tracks"> {data.map((song) => ( <div className="box" key={song.id}> <h2>{song.name}</h2> <h3>by {song.artist}</h3> <p> from {song.album}</p>…

VIEW QUESTION
Back To Top
Search