So I was going through lot of YouTube videos on this topic...wich made me eventually find wtf is this concept ...is ..
In javascript a function is nothing but an value,
Consider
Function Myrollno(value){
return value
}
let outputvalue = Myrollno(21)
So if we
console.log(outputvalue)
Output :
21
Hmm...so what happens we pass function instead of a value to the function ....that's what Higher order functions are...
Still not clear .. consider
the example below
var filtered = [12,5,8,130] ;
functionisAboveMyRange(value){
return value >= 25;
}
filtered.filter(isAboveMyRange);
So 'filter' Function is called as an Higher order function ,the function we pass as Argument is called an callback function...
Still having Doubts comment it
Top comments (0)