After a function expression has been stored in a variable, the variable can be used as a function: - Javascript Function

Javascript examples for Function:Function Definition

Description

After a function expression has been stored in a variable, the variable can be used as a function:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var x = function (a, b) {return a * b};
document.getElementById("demo").innerHTML = x(4, 3);
</script>/*from ww  w. j a va 2 s .c  o m*/

</body>
</html>

Related Tutorials