Complete the code to initialize Firebase Cloud Functions.
const functions = require('firebase-functions'); const admin = require('[1]');
The firebase-admin package is used to initialize admin SDK for Cloud Functions.
Complete the code to export a simple HTTP Cloud Function named 'helloWorld'.
exports.helloWorld = functions.[1].onRequest((request, response) => { response.send('Hello from Firebase!'); });
The https namespace is used to create HTTP triggered Cloud Functions.
Fix the error in the code to initialize the Firebase Admin SDK.
admin.[1]();The correct method to initialize the admin SDK is initializeApp().
Fill both blanks to create a Firestore triggered Cloud Function that runs on document creation.
exports.newUser = functions.firestore.document('[1]').[2]((snap, context) => { const newValue = snap.data(); return null; });
The function triggers on new documents created in the 'users/{userId}' path using onCreate.
Fill all three blanks to create a scheduled Cloud Function that runs every day at midnight.
exports.dailyJob = functions.pubsub.schedule('[1]').timeZone('[2]').onRun((context) => { console.log('[3]'); return null; });
The schedule string for midnight is every day at midnight, the timezone is set to America/New_York, and the log message confirms the job ran.