38 lines
1.2 KiB
HTML
38 lines
1.2 KiB
HTML
<!doctype html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Übung 4: Glück & Codes</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">
|
|
<div class="alert alert-primary">
|
|
<h2>Übung 4: Glück & Codes</h2>
|
|
<p>
|
|
Kennst du Glückszahlen und Namenscodes? Hier ist ein Namenscode mit einem interessanten Schema:
|
|
Multipliziere die Länge deines Vornamens mit der Länge deines Nachnamens und lass dir das Ergebnis in der
|
|
Konsole ausgeben.
|
|
</p>
|
|
</div>
|
|
<div class="output alert alert-secondary my-3"></div>
|
|
</div>
|
|
</main>
|
|
<script>
|
|
'use strict';
|
|
|
|
let outputEl = document.querySelector('.output');
|
|
|
|
let firstName = 'Andreas';
|
|
let lastName = 'Rohleder';
|
|
let lengthName = firstName.length * lastName.length;
|
|
|
|
outputEl.textContent = lengthName;
|
|
console.log(lengthName); // => 56
|
|
console.log('Philippe'.length * 'Torrel'.length); // => 48
|
|
</script>
|
|
</body>
|
|
</html>
|