August 2012
Beginner
583 pages
16h 1m
English
As with PHP, JavaScript functions are used to separate out sections of code that perform a particular task. To create a function, declare it in the manner shown in Example 13-5.
<script>
function product(a, b)
{
return a*b
}
</script>This function takes the two parameters passed, multiplies them together, and returns the product.
Read now
Unlock full access