Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Pass Arguments to a Function</title> </head> <body> <script> // Defining function function showFullname(firstName, lastName) { document.write(firstName + " " + lastName); } // Calling function showFullname("Clark", "Kent"); // Prints: Clark Kent document.write("<br>"); showFullname("John"); // Prints: John undefined </script> </body> </html>