34,333
edits
Changes
→Returning a Value from a Function
Next we need to look at how a function might return a value.
<pre>
<html>
<head>
<title>A Simple JavaScript Function Example</title>
<script language="JavaScript" type="text/javascript">
function sayHello()
{
alert("Hello!");
}
</script>
</head>
<body>
<h1>Calling a function</h1>
<script language="JavaScript" type="text/javascript">
sayHello( "24th", "July" );
sayHello ( "1st", "August" );
sayHello ( "24th", "May" );
</script>
</body>
</html>
</pre>
<h1>Calling a function</h1>