Is there any difference between: window.localStorage and localStorage?

后端 未结 5 542
执笔经年
执笔经年 2021-01-07 17:46

I have been doing the following:

var store = window.localStorage;
store.setItem()

but now I see code doing this:

localStora         


        
5条回答
  •  时光说笑
    2021-01-07 18:31

    This is old, but today I may have found a difference.

    I have a React app that was 'forgetting' the localstorage values when I ran it on my server with SSL without the WI DOW . Without SSL, it was working fine.

    I went back and added the WINDOW to all the references to localstorage and the problem disappeared

提交回复
热议问题