<html>
<head>
<title>Function as an Argument Example</title>
<script type="text/javascript">
function callSomeFunction(someFunction, someArgument){
return someFunction(someArgument);
}
function add10(num){
return num + 10;
}
var result1 = callSomeFunction(add10, 10);
alert(result1); //20
function getGreeting(name){
return "Hello, " + name;
}
var result2 = callSomeFunction(getGreeting, "Nicholas");
alert(result2); //Hello, Nicholas
</script>
</head>
<body>
</body>
</html>