variables and functions

This commit is contained in:
Geir Okkenhaug Jerstad 2024-08-19 13:36:00 +02:00
parent 20fbf34ec8
commit c8446d5c93
6 changed files with 177 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Let & var scopes</title>
</head>
<body>
<script>
function testScopes() {
var hello = "Var hello";
let hello2 = "Let Hello";
console.log(hello,hello2);
{
var yo = "Var yo i obj";
let yo2 = "Let yo i obj";
console.log(yo, yo2);
}
console.log(yo);
}
testScopes();
</script>
</body>
</html>