I have the following code to set items to localstorage and it is working fine except for the last item has array from the pervious item.
var catname; var catA