Complete the code to initialize Firebase Authentication.
const auth = [1](app);The getAuth() function initializes the Firebase Authentication service.
Complete the code to create a new user with email and password.
firebase.auth().[1](email, password).then(userCredential => { console.log('User created'); });
The createUserWithEmailAndPassword method creates a new user account with the given email and password.
Fix the error in the code to handle signup errors correctly.
firebase.auth().createUserWithEmailAndPassword(email, password).catch(error => { console.error([1]); });The error.message property contains a readable description of the error, which is best for logging.
Fill both blanks to import and initialize Firebase app correctly.
import { [1] } from 'firebase/app'; const app = [2](firebaseConfig);
You import initializeApp and then call it with your config to start Firebase.
Fill all three blanks to sign up a user and handle success and error.
firebase.auth().[1](email, password) .then(userCredential => { console.log('User ID:', userCredential.user.[2]); }) .catch(error => { console.error('Error:', error.[3]); });
Use createUserWithEmailAndPassword to sign up, access the user's uid for ID, and log the error message on failure.