I am very very new to JavaScript, so please bear with me!.
I was wondering if you pass a function as a parameter to another function in JavaScript, for example (disclaimer: the code may not be 100% correct, but you should get the idea!):
function(param1, param2) {
   ....
   // Do something with param 1
   param1 += 10;
   ....
   // Param 2 is a function, so call it
   param2();
   .....
}
Is this a potential security risk, or is this a common way of programming in JavaScript?.
Thanks.
 
     
     
    