Function expression:
Expression will return a result immediately .
ex:2+3 will return 5.so this is a expression.
similarly , assume a function expression-
Function expression:
Expression will return a result immediately .
ex:2+3 will return 5.so this is a expression.
similarly , assume a function expression-
<script>
var
calSub =
function
(x, y){
return
x - y;
}
console.log(
"Subtraction : "
+ calSub(7, 4));
</script>
here calSub is a function expression.
function
calcAddition(number1, number2)
{
return
number1 + number2;
}
When single task can be done by multiple groups/family of objects and decision is taken at the runtime.
No comments:
Post a Comment