Si tengo una clase mecanografiada que tiene los siguientes datos:
private _initialNames: any; async getData(): Promise<any> { const resp = await fetch(url); const { data } = await resp.json(); this._initialNames = data.reduce( (acc: any, curr: any) => ({ ...acc, [curr.name]: { found: curr.found, age: curr?.age, } }), {} ); return this._initialNames; } cuando llamo a esta función, ¿por qué uso await getData() ? ya que está devolviendo una matriz, no una Promesa? Sé que tengo que usar async ya que estoy esperando una búsqueda interna, pero cuando llamo a la función real, ¿todavía la espero?