Project 4: Photo Gallery
JS Wizard
Builds on these lessons
Step 1 of 3
Project
A Function Declaration
Write a function formatCaption(photographer, location) that returns a formatted string. Wrapping this logic in a function means you write it once and call it for every photo, instead of repeating the same string-building code each time.
🎯 Your Task
Please add the exact code shown in the light gray box below to your editor.Do not delete your previous code, just insert these new lines in the correct place!
function formatCaption(photographer, location) {
return "Photo by " + photographer + " in " + location;
}
console.log(formatCaption("Mia Chen", "Big Sur"));