Editor Arrow Download Open
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JavaScript anonymous function</title> </head> <body> <pre> <!-- Use pre element for work document.writeln() method --> <script type="text/javascript"> fun1(); // undefined! - Remove fun1(); statement and run again var fun1 = function() { document.writeln("Hello world!"); } // anonymous function expression fun1(); // called </script> </pre> </body> </html>
  Preview Arrow