Pergunta de entrevista da empresa Uber

memoize is a function that takes one argument, asynchronousFunction: function memoize(asynchronousFunction) { } where asynchronousFunction is a function that takes n arguments. The last argument of asynchronousFunction is a callback in the form of function callback(error, result).

Resposta da entrevista

Sigiloso

9 de dez. de 2024

function memoize(asynchronousFunction) { const calculatedResult = new Map(); return async function(...params) { ... } }