使用LocalStorage出现Uncaught TypeError: storage.setItem is not a function错误

使用LocalStorage出现Uncaught TypeError: storage.setItem is not a function错误,浏览器是谷歌80版本,使用window.sessionStorage.setItem(key, value)这种方式报错,使用window.sessionStorage["key"] = value和window.sessionStorage.key = value这两种方式却没有问题,求大佬指导!

代码截图:

图片说明

报错截图:

图片说明

https://www.oschina.net/question/870297_245436?sort=time