This commit is contained in:
Philippe Torrel
2026-08-17 14:24:43 +02:00
parent 2f8cd0b61e
commit c7d26e1cd9
17 changed files with 1255 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Übung 6: Benutzer erstellen</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<main>
<div class="container py-5">
<h1>Übung 6: Benutzer erstellen</h1>
</div>
</main>
<script>
'use strict';
function createUser(name, email, age {
return {
name: name,
email: email,
age: age,
greet: () => {
console.log("Hello, " + name + "!");
},
updateEmail(newEmail) {
email = newEmail;
console.log("Email updated to " + newEmail);
}
;
}
const users = [
createUser("Alice", "alice@example.com", 30),
createUser("Bob", "bob@example.com", 25),
createUser("Charlie", "charlie@example.com", 35),
];
users.forEach(user => {
user.greet();
user.updateEmail("new_" + user.email);
});
function calculateTotal(a, b, c) {
return a + b + c;
}
console.log("Total:", calculateTotal(10, 20 30));
</script>
</body>
</html>