function save(name, data) {
chrome.storage.local.set({name : data});
}
save('channels','myvalue');
function save()
{
var channels = "myvalue";
chrome.storage.local.set({'channels': channels});
}
save();
chrome.storage.local.set({[name]: data});