< head>

< script type="text/javascript">
function myFunction()
{
     return ("Hello, have a nice day!");
}
< /script>

</head>

< body>

< script type="text/javascript">
     alert(myFunction());
< /script>

</body>

The function myFunction() returns a text "hello, have a nice day!".

myFunction() takes on the value "Hello, have a nice day!" using the key work return.

The script in the body section calls a myFunction(). This is a function calling a function.

The alert method displays the valu of myFunction().

Below are two scripts, one in the head section and the other in the body section. The script in the body section calls the script in the head section to obtain a vlue to display.