The getItem() method of the Storage interface, when passed a key name, will return that key’s value, or null if the key does not exist , in the given Storage object.
getItem()
Storage
null
Storage: getItem() method - Web APIs | MDN (mozilla.org)
With the above information on getItem() , maybe you have to setItem() the key/value pair first before you “get” them.
setItem()
Storage: setItem() method - Web APIs | MDN (mozilla.org)