Can anyone please help me. I am appending the data in local storage and it is taking duplicate values as well. Anyone know how to ignore duplicate values and append only unique values? I tried to check other similar types of stack-overflow, but not work for me, please help me!
Please see the attached code and its output for reference:-
getProgramDetails = (ppTermDetails) => {
this.programDetails = ppTermDetails;
var entry = this.programDetails;
sessionStorage.setItem("entry", JSON.stringify(entry));
var allEntries = JSON.parse(sessionStorage.getItem("allEntries")) || [];
allEntries.push(entry);
sessionStorage.setItem("allEntries", JSON.stringify(allEntries));
};