I have a series of if and else if statements and what I want is to determine a scenario in terms of local storage being empty.
I've tried:
(if localStorage.getItem('example') == localStorage.clear()) {
//Do something if that local storage item is empty
}
I am aware the program may think I'm assigning the local storage to clear out it's contents. So would I do something like:
(if localStorage.getItem('example') == localStorage()) {
//Do something if that local storage item is empty
}
If not, how can I refer to the local storage as an empty object so the program doesn't get confused thinking that I'd like to clear the contents in the storage?