JavaScript: Written Output and Comments

Post Reply
User avatar
The Jason
Site Admin
Posts: 853
Joined: Tue Jul 01, 2025 10:13 am

Code: Select all

<!DOCTYPE html>

<html>

<head><title>JavaScript Examples</title></head>

<body>

<script>

// This is a single line comment.

/*  This is a multi-line comment.
Here is the 2nd line */

window.alert("The forum is called Hosting Chatter..");

// The line outputs "The forum is called Hosting Chatter" (no parentheses) on window.

let month = "January";

// Below is string interpolation so you don't have to worry about spacing and putting in variables as much.

window.alert("${month} is considered a cold month in the temperate nations of the Northern Hemisphere.")

// outputs "January is considered a cold month in the temperate nations of the Northern Hemisphere." (no parenthesis) on window.

</script>


</body>

</html> 


 

POSTREACT(ions) SUMMARY

Post Reply