A. getDownloadURL returns a Promise, so url is not the actual URL string.
B. fileRef is not defined.
C. getDownloadURL is not imported.
D. console.log cannot print URLs.
Solution
Step 1: Identify getDownloadURL return type
getDownloadURL() returns a Promise, not the URL string directly.
Step 2: Understand why console.log prints a Promise
Without awaiting or using .then(), url holds a Promise object, so console.log prints the Promise, not the URL.
Final Answer:
getDownloadURL returns a Promise, so url is not the actual URL string. -> Option A
Quick Check:
Missing await means url is Promise, not string [OK]
Hint: Always await getDownloadURL to get the URL string [OK]
Common Mistakes:
Forgetting that getDownloadURL returns a Promise
Assuming console.log prints resolved Promise value
Ignoring async/await syntax requirements
5. You want to display an image from Firebase Storage in your web app using its download URL. Which approach correctly handles errors if the file is missing or access is denied?