JavaScript Functions
<!DOCTYPE html> <html> <body> <h2>Declaring and calling a function</h2> <script> function greet() { console.log("Hello there!"); } // Nothing prints until we call it greet(); // "Hello there!" greet(); // "Hello there!" (call it as often as you like) </script> </body> </html>