Google Cloud Function undefined argument detected as null

Viewed 231

When I pass an undefined argument to my cloud function, it is detected as null. For example, if I have this:

 const a = undefined;

 firebase.functions().httpsCallable("myFunction")({
    a
 });

And in my cloud function I do:

...
.https.onCall(async (data, context) => {

    const {a} = data;

    console.log(a);

    ...
});

It prints "null" and not "undefined".

myFunction: null

Why?

1 Answers
Related