Pregunta de entrevista de DoControl

Explain what certain javascript vectorial functions filter and find, explain what the code does and if it could be implemented more efficiently.

Respuesta de la entrevista

Anónimo

5 may 2023

Since find was find in the body of the filter callback, it means running on O(N^2 ) while it could be NLog(N) if they used a dictionary as data structure, instead of arrays.