JSFiddle - React, Tailwind, and code Playground
HTML
<div id="res">ttt</div>
JavaScript
localStorage["results"] = JSON.stringify([{"id":"item-1","href":"google.com","icon":"google.com"},
{"id":"item-2","href":"youtube.com","icon":"youtube.com"},
{"id":"item-3","href":"google.com","icon":"google.com"},
{"id":"item-4","href":"google.com","icon":"google.com"},
{"id":"item-5","href":"youtube.com","icon":"youtube.com"},
{"id":"item-6","href":"asos.com","icon":"asos.com"},
{"id":"item-7","href":"google.com","icon":"google.com"},
{"id":"item-8","href":"mcdonalds.com","icon":"mcdonalds.com"}]) ;
alert(localStorage["results"]);
function getItemHrefById(json, itemId){
return json.filter(function(testItem){return testItem.id == itemId;})[0].href;
}
var json = JSON.parse(localStorage["results"]);
var href = getItemHrefById(json, "item-3");
$("#res").html(href);
alert(localStorage.getItem("results"));
localStorage.removeValue("results");