This commit is contained in:
Philippe Torrel
2026-06-25 15:15:51 +02:00
parent 70794eab31
commit 878c0f7c6b
14 changed files with 896 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Übung 44: Quersumme berechnen</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">
<h1>Übung 44: Quersumme berechnen</h1>
<p>
Schreibe eine Funktion digitSum, die die Quersumme einer übergebenen Zahl zurückgibt.
<strong>Hinweis:</strong> Die Quersumme ist die Summe aller Ziffern einer Zahl. <br /><strong>Tipp:</strong>
Verwenden Sie split('').
</p>
</div>
</div>
</main>
<script>
'use strict';
const number = 4566;
const getDigitSum = (n) => {};
console.log(getDigitSum(4242)); //=> 12
console.log(getDigitSum('13')); //=> 4
//========
</script>
</body>
</html>