Complete the code to delete a file from Firebase Storage.
const storageRef = firebase.storage().ref();
storageRef.child([1]).delete();You need to specify the file path as a string inside child() to delete that file.
Complete the code to handle the promise returned by the delete operation.
storageRef.child('path/to/file.txt').delete().[1](() => { console.log('File deleted successfully'); });
catch() instead of then() for success.resolve() which is not a method on promises.The delete() method returns a promise. Use then() to run code after successful deletion.
Fix the error in the code to properly catch errors during file deletion.
storageRef.child('path/to/file.txt').delete().then(() => { console.log('Deleted'); }).[1]((error) => { console.error('Error:', error); });
then() twice instead of catch().error() method.Use catch() to handle errors from the promise returned by delete().
Fill both blanks to delete a file and log success or error messages.
storageRef.child([1]).delete().[2](() => { console.log('File deleted'); }).catch((error) => { console.error('Delete failed:', error); });
catch instead of then for success handling.Specify the file path as a string in child() and use then() to handle success.
Fill all three blanks to delete a file, handle success, and handle errors properly.
const fileRef = storageRef.child([1]); fileRef.delete().[2](() => { console.log([3]); }).catch((error) => { console.error('Failed:', error); });
catch instead of then for success.Use the file path string for child(), then() for success, and a success message string inside console.log.
