Pregunta de entrevista de Workiz

How js will prioritize functions asynchronously. How does an index work on a database