Looping Through Images

In Chapter 5, “Data (Types), Data (Structures), Data(bases),” you created an array of the images on Facebook in getImages.js. Your challenge for this chapter is to loop through each item in the images array and print the image’s URL (the src attribute) to the console using console.log. (Hint: To get this to work, you should comment out the last line of prompt.js, as shown in Listing 7.17.)

Listing 7.17 Comment Out the Last Line of prompt.js

// Insert the output into the web page.// document.body.innerHTML = output;

You have already learned everything you need to know to complete this challenge, so I’m not going to show you how to do it. Use Listing 7.16 as an example, and do some research ...

Get Learning to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.