I am building a wrapper function to retrieve values stored in a WebExtension's local Storage. I am struggeling to pass the return value of the success function to its outer function. Many thanks in advance!
 get(key) {
    browser.storage.local.get(key).then(onGot, onError);
    function onGot(storage) {
        console.log(storage[key]); // Works so far
    }
    function onError() {
        return false;
    }
    // How can I return storage[key] here?
}
 
    