— Why i need to pass a fonction like a parameter for other function ??
For asynchronous functions where you don't control when the function is done, you can pass the callback, and it will be called when it's done
asyncFunction(param1, param2, callback)// someOtherStuff...
Message permanent page
— Does that make sense Adan?
— Thank you
— No, querySelectorAll obviously does more work
— Where is the test?
— It may do more work, but getElementsByClassName may be doing even more work🤤
— ClassName takes a class name, querySelector takes a query, which it has to parse
— To find potentially classnames, potentially other stuff
— And THEN it executes what it parsed