Functions are the fundamental unit of action in jQuery. The main entry point of most jQuery applications is a block of code that looks like
$('document').ready(function() {
//do something;
});
An understanding of JavaScript functions will help you to get the most out of jQuery.
There are two ways to define a function but we've been mainly showing you this approach:
var myFunction = function() {
//do something;
}
We use this method because it is slightly more flexible than the other approach but the differences are not that important.
Write two functions:
sayHello()that returns just "hello"multiplyThree(x,y,z)which takes three numbers and returns the product of all three of them multiplied together. SomultiplyThree(3,5,7)should return 105.