Html
<html>
<body>
<script>
function calcSum(a, b)
{
return a + b;
}
// Option 1. Is there a function calcSum ? For verification, we use ==
if (typeof calcSum == "function")
alert("Function found calcSum");
else
alert("Features NOT found calcSum");
// result "Function found calcSum"
// Option 2. Is there a function calcSum ? For verification, we use !=
if (typeof calcMul != "function")
alert("Features NOT found calcMul");
else
alert("Function found calcMul");
// result "The function is there calcMul"
</script>
</body>
</html>