I am looking for a way to calculate the length of an array returned by a promising function:
getUserStockMovementList(userID: string): Promise<calculatedMovement[]>
Any suggestions on how to achieve this?
Is it possible to store a promise-returning function in a constant variable?
const stockMovements = getUserStockMovementList(userID);
for (let i = 0; i < rawMovementList.length; i++) {
// perform actions
}