Best way to get response from cloud code (Javascript)

Hello, I’ve been looking on parse documentations but I’m a bit confused.
I’ve been though this tutorial where it says I should make my backend operations though Cloud Code.

For my user profile Cloud Code I have the following:

Parse.Cloud.define("getUserInfo",async(request) => {
  let currentUser = request.user;
  let query = new Parse.Query("User");
  let results = await query.find({useMasterKey:true});
  if(results.length === 0) throw new Error('No results found!');  
  let user = results[0];  
  let userInfo = [];
return userInfo;

And in the client side (I’m using Angular):

    let response ='getUserInfo');

This is what I get:
Captura de ecrã 2021-10-15, às 11.52.03
I’m not sure how to read the response in the promise.
And right now I’m not even sure this is the best way to do it and I really haven’t found what I’m looking for on the web.
So I would greatly appreciate some help on this.

Use await

let response = await'getUserInfo');


let response ='getUserInfo');
response.then(result => {

}).catch(error => {


thank you, it worked!