Declare a function - Javascript Function

Javascript examples for Function:Function Definition

Description

Declare 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  av  a2  s .co m

</body>
</html>

Related Tutorials