JavaScript: Variable Names

Post Reply
User avatar
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>

// Variable names can start with an underscore, letter, or dollar sign.  They can contain the same and also numbers.

// Variable names are case sensitive.

// "let" variables cannot be redeclared in the same scope.  They cannot be accessed outside it's scope.

let _the_first_name = "Amber";

let $the_second_name = "Eddie";

let the_third_name = "Joleen";

let the_integer_after_2 = 3;

let the_fourth_name$ = "Melinda"';

// JavaScript variables declared with var have global scope.



</script>


</body>

</html> 





 

POSTREACT(ions) SUMMARY

Post Reply