Remove variables starting with a string from chrome.storage.local in JavaScript
问题 In a chrome extension, I store some variables in chrome.storage.local like this: chrome.storage.local.set({["name" + counter]: ""}, function() {}); (many thanks to Xan's answer regarding ES6 computed property names here), where counter is basically an incremented number. How can I use chrome.storage.local.remove to remove all the variables starting with "name" that were previously stored, when I don't need them anymore? Note: I use this type of storage ("name0", "name1", ...) as I can't store