Acabo de empezar un par de javascript hace unos días. Ambas funciones producen lo mismo. Entonces, ¿cuál es la diferencia entre ellos?
Primer método:
function fakeAjax(url,cb) { setTimeout(function fakeLoadingDelay(){ cb([ "A Song of Ice and Fire", "The Great Gatsby", "Crime & Punishment", "Great Expectations", "You Don't Know JS" ]); },500); }Segundo método:
function fakeAjax(url,cb) { setTimeout(cb([ "A Song of Ice and Fire", "The Great Gatsby", "Crime & Punishment", "Great Expectations", "You Don't Know JS" ]) ,500); }Muchas gracias por adelantado.