Is it possible to create a hook system in javascript as like as php ?
for an example ----
function myjsfunction(){
call_my_function('handle_name');
}
now whatever function people add with 'handle' name it should get executed there.
like
add_to_function('handle_name', function(){alert('hi')});
add_to_function('handle_name', function(){alert('hello')});
both these functions should execute