Created
September 11, 2012 13:40
-
-
Save gojun077/3698550 to your computer and use it in GitHub Desktop.
CodeAcademy - Review of Functions in JS Sec 2/3, Ex 1/4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. A Function with 2 Parameters | |
Functions can have zero, one or more parameters. You can | |
think of these as input that the function receives, and | |
then uses to do something. | |
The code example shows a trivial function multiply function | |
that takes two numbers as arguments and returns their product. | |
Do you remember how volume is defined? Complete the definition | |
of the volume function. | |
*/ | |
var multiply = function (x, y) { | |
return x * y; | |
}; | |
multiply(2, 5); | |
var volume = function (l, w, h) { | |
return l * w * h; | |
}; | |
volume(2, 3, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment