<title> Greeting </title>
alert ("Hello, "+ who + '' + who2);
var who = prompt ("what is your first name");
var who2 = prompt ("what is your last name");
alert("Hello " + who + ' ' + who2);
Functions are good for helping you reuse code blocks that do specific tasks without having to write the code again and again, you just call a function and the interpreter then fetches that code block, runs it and the output is then generated if any output is needed, etc.
Functions are your friend :)
12-19-2013, 10:35 AM