With using the Chrome API, I am wondering how I would go about passing an array though the sync.set ability.
var itemname = ["itemid1", "itemid2", "itemid3"]
var itemvalue = ["itemval1", "itemval2", "itemval"]
for (i = 0; i < itemname.length; ++i) {
chrome.storage.sync.set({ itemname[i]: itemvalue [i] });
}
Information would be stored within the itemname
and itemvalue
which would be variables for their inner value. Now I know to a certain degree that this isn't exactly how this works, and if anyone has a possible closest working solution for storing many different pieces of information using one line rather than having multiple chrome.storage.sync.set
tags cluttering the code, that would be amazing.