I need to negate/toggle the boolean value of a variable which is in chrome.storage.local but it's throwing an error:
var toggle = chrome.storage.local.get('toggle');
chrome.storage.local.set({ "toggle": !toggle }, function() {
console.log('Settings saved');
});
I tried getting the variable first but it's showing an error: Invocation of form get(string) doesn't match definition get(optional string or array or object keys, function callback). Any help appreciated!