The two calls preferences need, and no more.
Narrower than Storage on purpose: a caller substituting one only has to supply what is used here, not length, key, clear and removeItem as well. window.localStorage satisfies it as it stands.
Storage
length
key
clear
removeItem
window.localStorage
The two calls preferences need, and no more.
Narrower than
Storageon purpose: a caller substituting one only has to supply what is used here, notlength,key,clearandremoveItemas well.window.localStoragesatisfies it as it stands.