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

jQuery

Avatar of undefined
Last Comment
leakim971
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of JRockFL
JRockFL
Flag of United States of America image

ASKER

Go it. thank you.
Avatar of leakim971
leakim971
Flag of Guadeloupe image

'welcome!
jQuery
jQuery

jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.

19K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo