Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Using a Variable Before it is Initialized</title> </head> <body> <script> document.write(str); // Prints: undefined var str; str = "Hello World!"; </script> </body> </html>