Page 1 of 1

JavaScript: Declaring Variables Beforehand

Posted: Sun Aug 03, 2025 10:26 am
by The Jason

Code: Select all

<!DOCTYPE html>

<html>

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

<body>

<script>

let x;

// Variable is declared beforehand, before it is given a value.

x = 6; 

let name;

name = "William";

let GPA;

GPA = 4.0

// LOL

</script>


</body>

</html>