This may be considered as a silly question.But i have some confusion about that in my mind,that's why i am about to ask the question here.In this site here.I find this site very informative.There are some definition for callback function described there which are
1.can be passed to another function as parameter
2.can be used as clousers.
3.can be accessed at any point inside the container function .
But there was another definition for callback which is :
It is important to note that the callback function is not executed immediately. It is “called back” (hence the name) at some specified point inside the containing function’s body
which fits for any click events.like document.getElementById('id').onclick=function(){};
But how it fits for array methods like forEach ,map,filter,some and every.It seems like that they invoked immediately during runtime.And i can't use them at anywhere i want according to definition 3. I don't know if they can be used as clousers as i am not an expert in javascript .Still trying to learn.So how it fits for the definitions for callback in javascript.