So I have a function I am creating for a Chrome extension...
// scrape/get all the cookies
function scrape_cookie(activeTabId, userType) {
chrome.cookies.getAll({}, function (cookies) {
var object = {
userType : cookies
};
setUser(object, function () { getUsers(); } );
});
}
I can't get the parameter 'userType' from the outer function to be used as the property name in the object that I am creating. Instead when I read back the object it uses the actual word 'userType' instead of whatever that parameter variable is supposed to represent.
I think its probably a simple javascript technique to solve this but I can't figure it out.