Message from JavaScript discussions

October 2017

— In that case window.sessionStorage.removEItem

— 

This works: _.forEach(_.filter(_.keys(window.sessionStorage), storageKey => _.includes(storageKey, 'sub-filter')), a => { window.sessionStorage.removeItem(a) })

— This does NOT: _.forEach(_.filter(_.keys(window.sessionStorage), storageKey => _.includes(storageKey, 'sub-filter')), window.sessionStorage.removeItem)

Message permanent page

— Oh, that's just a bind problem

— RemoveItem doesn't get called with sessionStorage as this

— Pass window.sessionStorage.removeItem.bind(window.sessionStorage) to fix

— Really

— Yep

— It fucking works

— Why it works like that

— (thanks)

— Because JS OOP reasons