Skip to content
Advertisement

How can I access return value of Map from function in Node.js for Cloud Function?

I had read this post How to return values in javascript. But my question is how do we get the Map value if we derived it from asynchronous function like in this code below:

JavaScript
I want to use the value from this function using this code:

JavaScript
Please, help me out. Any tips and trick will be great. Thank you very much for spending time to read this post.

Advertisement

Answer

Both are correct in Javascript,

  • 1- Dot property accessor: object. property.
  • 2- Square brackets property access: object[‘property’]
  • 3- Object destructuring: const { property } = object.

This style is named Object Dot Notation access

JavaScript

and this one is Object Bracket notation access

JavaScript

Read more here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement