Przemyslaw MazurPro Student 9,296 Points
Why this code works ?
My question is why the displayPhotos function works before $.getJSON runs?
I Dilate3,979 Points
$.getJSON sends a request to a server, which is likely to be slower returning than the time that the rest of the code in your script takes to be executed.
Remember a few lessons back, you were told that AJAX queries return at different times, and you can't predict which one comes back first? This is a good example.
Note: your question was a little vague - this is the best I can do to answer it without you providing more information. If you're experiencing a specific problem with this challenge, can you elaborate please?