This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Datentypen und der Befehl "typeof" in JS</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="container py-5">
|
||||
<h1>Datentypen und der Befehl "typeof" in JS</h1>
|
||||
<div class="output alert alert-secondary my-3"></div>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
let outputEl = document.querySelector('.output');
|
||||
|
||||
console.log(typeof 3764); // => 'number';
|
||||
console.log(typeof 'beautiful JS'); // => 'string';
|
||||
console.log(typeof 27.31); // => 'number';
|
||||
console.log(typeof -3.14); // => 'number';
|
||||
|
||||
console.log(typeof '-3.14'); // => 'string';
|
||||
console.log(typeof '3.14'); // => 'string';
|
||||
|
||||
// prettier-ignore
|
||||
console.log(typeof "123"); // => 'string'
|
||||
console.log(typeof `123 + 1`); // => 'string'
|
||||
console.log(typeof `${123 + 1}`); // => 'string'
|
||||
|
||||
console.log(typeof true); // => 'boolean'
|
||||
console.log(typeof false); // => 'boolean'
|
||||
|
||||
console.log(typeof function () {}); // => 'function'
|
||||
console.log(typeof 0b1001); //=> 'number'
|
||||
|
||||
console.log(typeof 123n); // => 'bigint' (2020)
|
||||
|
||||
// =======================
|
||||
console.log(typeof 4 + 4); // => 'number4'
|
||||
console.log(typeof (4 + 4)); // => 'number'
|
||||
|
||||
console.log(typeof undefined); // => 'undefined'
|
||||
console.log(typeof var2); // => 'undefined'
|
||||
|
||||
console.log(typeof [1, 2, 3]); //=> 'object' vom Typ Array
|
||||
console.log(typeof { firstName: 'John', age: 30 }); //=> 'object' vom Typ Object
|
||||
console.log(typeof null); //=> 'object' vom Typ Null
|
||||
console.log(typeof outputEl); //=> 'object' vom Typ HTMLDivElement (Node)
|
||||
console.log(typeof outputEl.classList); //=> 'object' vom Typ DOMTokenList
|
||||
|
||||
console.log('b' + 'a' + +'a' + 'a'); //=> 'baNaNa'
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Prioritäten-Tabelle</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="container py-5">
|
||||
<h1>Prioritäten-Tabelle</h1>
|
||||
<!-- TODO: Tabelle in HTML aus Lektion (3.7.2) erstellen -->
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
'use strict';
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user