javascript - What to do if there is no data in localStorage? -
i'm in dilemma, have search engine keep last results, perfect until there.
the problem not know if not have items saved, ie if first time search.
if(localstorage.getitem("searchresults") === null) { // not know here ... } else { // here code supposed has }
should not anything, should save empty string, or have change logic i'm working on?
what friends, doing? thank you
i have variable called "noresults", , set false
, when search results 0, or can make fetch results server. it's context , logic
Comments
Post a Comment