Is this possible? The real world example is here:
var userKey = "userIdKey";
chrome.storage.sync.set({ userKey: "Hello World" }, function () {
chrome.storage.sync.get(userKey, function (data) {
console.log("In sync:", data);
});
console.log("Success");
});
This example currently fails because the getter looks for "userIdKey" where as the setter interprets the variable literally as "userKey"
UPDATE: I am fully aware of accessing a variable via array notation. The realworld example I have provided is for the creation of the object. I am hoping to ensure that the same key is always used for getting and setting -- rather than relying on two string constants being kept in sync.