Link to home
Create AccountLog in
Avatar of JRockFL
JRockFLFlag for United States of America

asked on

Access values in array

I'm trying to understand this code and how I can access the values that have been added to the array.

Once the values have been added to array, how can I access id and url?
    var photoList = {};
    var toUpload;
    var id = $(this).attr('id');
    var url = $(this).attr('rel');

            toUpload = { id: id, url: url };
            if (id in photoList) {
                delete photoList[id];
            }
            else {
                photoList[id] = toUpload;
            }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of JRockFL

ASKER

Go it. thank you.
'welcome!