From c7d26e1cd94423c0e45d60248b52c044c0a88515 Mon Sep 17 00:00:00 2001 From: Philippe Torrel Date: Mon, 17 Aug 2026 14:24:43 +0200 Subject: [PATCH] --- .../uebungen/u01_bibverwaltung/index.html | 70 ++++ .../uebungen/u02_extraction/index.html | 70 ++++ 06_js-debug/uebungen/u03_dry/index.html | 49 +++ .../u04_dry-benutzerzugang/index.html | 246 +++++++++++ .../uebungen/u05_error-format-date/index.html | 27 ++ .../uebungen/u06_error-benutzer/index.html | 51 +++ .../uebungen/u07_check-temperature/index.html | 37 ++ .../uebungen/u08_benutzer-anzeigen/index.html | 57 +++ .../uebungen/u09_parse-user-data/index.html | 32 ++ .../uebungen/u10_einkaufspreis/index.js | 40 ++ .../uebungen/uebungen-01-10-js-debug.zip | Bin 0 -> 16435 bytes .../tag46/04_error-types/03_type-error.html | 1 + .../tag46/04_error-types/04_type-error.js | 12 + .../tag46/04_error-types/04_type-error.ts | 23 ++ .../tag46/04_error-types/package-lock.json | 390 ++++++++++++++++++ .../tag46/04_error-types/package.json | 15 + .../tag46/05_logical-error/logical-error.html | 135 ++++++ 17 files changed, 1255 insertions(+) create mode 100644 06_js-debug/uebungen/u01_bibverwaltung/index.html create mode 100644 06_js-debug/uebungen/u02_extraction/index.html create mode 100644 06_js-debug/uebungen/u03_dry/index.html create mode 100644 06_js-debug/uebungen/u04_dry-benutzerzugang/index.html create mode 100644 06_js-debug/uebungen/u05_error-format-date/index.html create mode 100644 06_js-debug/uebungen/u06_error-benutzer/index.html create mode 100644 06_js-debug/uebungen/u07_check-temperature/index.html create mode 100644 06_js-debug/uebungen/u08_benutzer-anzeigen/index.html create mode 100644 06_js-debug/uebungen/u09_parse-user-data/index.html create mode 100644 06_js-debug/uebungen/u10_einkaufspreis/index.js create mode 100644 06_js-debug/uebungen/uebungen-01-10-js-debug.zip create mode 100644 06_js-debug/unterricht/tag46/04_error-types/04_type-error.js create mode 100644 06_js-debug/unterricht/tag46/04_error-types/04_type-error.ts create mode 100644 06_js-debug/unterricht/tag46/04_error-types/package-lock.json create mode 100644 06_js-debug/unterricht/tag46/04_error-types/package.json create mode 100644 06_js-debug/unterricht/tag46/05_logical-error/logical-error.html diff --git a/06_js-debug/uebungen/u01_bibverwaltung/index.html b/06_js-debug/uebungen/u01_bibverwaltung/index.html new file mode 100644 index 0000000..5ca7b90 --- /dev/null +++ b/06_js-debug/uebungen/u01_bibverwaltung/index.html @@ -0,0 +1,70 @@ + + + + + + Exercise: Nested If-Statements + + +

Exercise: Nested If-Statements

+ + + + diff --git a/06_js-debug/uebungen/u02_extraction/index.html b/06_js-debug/uebungen/u02_extraction/index.html new file mode 100644 index 0000000..5ca7b90 --- /dev/null +++ b/06_js-debug/uebungen/u02_extraction/index.html @@ -0,0 +1,70 @@ + + + + + + Exercise: Nested If-Statements + + +

Exercise: Nested If-Statements

+ + + + diff --git a/06_js-debug/uebungen/u03_dry/index.html b/06_js-debug/uebungen/u03_dry/index.html new file mode 100644 index 0000000..8c49d10 --- /dev/null +++ b/06_js-debug/uebungen/u03_dry/index.html @@ -0,0 +1,49 @@ + + + + + + Exercise: Don't Repeat Yourself (DRY) + + +

Exercise: Don't Repeat Yourself (DRY)

+ + + + diff --git a/06_js-debug/uebungen/u04_dry-benutzerzugang/index.html b/06_js-debug/uebungen/u04_dry-benutzerzugang/index.html new file mode 100644 index 0000000..147d1a1 --- /dev/null +++ b/06_js-debug/uebungen/u04_dry-benutzerzugang/index.html @@ -0,0 +1,246 @@ + + + + + + Advanced If-Else Statements (Enhanced Nesting) + + +

Advanced If-Else Statements (Enhanced Nesting)

+ + + + diff --git a/06_js-debug/uebungen/u05_error-format-date/index.html b/06_js-debug/uebungen/u05_error-format-date/index.html new file mode 100644 index 0000000..6b5b78a --- /dev/null +++ b/06_js-debug/uebungen/u05_error-format-date/index.html @@ -0,0 +1,27 @@ + + + + + + Übung 05: FormatDate Fehler + + + +
+
+

Übung 05: FormatDate Fehler

+
+
+ + + diff --git a/06_js-debug/uebungen/u06_error-benutzer/index.html b/06_js-debug/uebungen/u06_error-benutzer/index.html new file mode 100644 index 0000000..9261022 --- /dev/null +++ b/06_js-debug/uebungen/u06_error-benutzer/index.html @@ -0,0 +1,51 @@ + + + + + + Übung 6: Benutzer erstellen + + + +
+
+

Übung 6: Benutzer erstellen

+
+
+ + + diff --git a/06_js-debug/uebungen/u07_check-temperature/index.html b/06_js-debug/uebungen/u07_check-temperature/index.html new file mode 100644 index 0000000..6e37278 --- /dev/null +++ b/06_js-debug/uebungen/u07_check-temperature/index.html @@ -0,0 +1,37 @@ + + + + + + Übung 7: checkTemperature Fehler + + + +
+
+

Übung 7: checkTemperature Fehler

+

Versuche, den Code auszuführen, den Fehler zu identifizieren und ihn zu beheben.

+
+
+ + + diff --git a/06_js-debug/uebungen/u08_benutzer-anzeigen/index.html b/06_js-debug/uebungen/u08_benutzer-anzeigen/index.html new file mode 100644 index 0000000..ab63182 --- /dev/null +++ b/06_js-debug/uebungen/u08_benutzer-anzeigen/index.html @@ -0,0 +1,57 @@ + + + + + + Übung 8: Benutzer anzeigen + + + +
+
+

Übung 8: Benutzer anzeigen

+

+ Der folgende Code enthält mehrere Referenzfehler, die über verschiedene Teile des Codes verteilt sind. Deine + Aufgabe ist es, alle Referenzfehler zu identifizieren und zu beheben, um sicherzustellen, dass der Code + korrekt läuft. +

+
+
+ + + diff --git a/06_js-debug/uebungen/u09_parse-user-data/index.html b/06_js-debug/uebungen/u09_parse-user-data/index.html new file mode 100644 index 0000000..0d4a6b4 --- /dev/null +++ b/06_js-debug/uebungen/u09_parse-user-data/index.html @@ -0,0 +1,32 @@ + + + + + + Übung 9: parseUserData Fehler + + + +
+
+

Übung 9: parseUserData Fehler

+

Die Kommentare zeigen das erwartete Ergebnis.

+
+
+ + + diff --git a/06_js-debug/uebungen/u10_einkaufspreis/index.js b/06_js-debug/uebungen/u10_einkaufspreis/index.js new file mode 100644 index 0000000..d140439 --- /dev/null +++ b/06_js-debug/uebungen/u10_einkaufspreis/index.js @@ -0,0 +1,40 @@ +function calculateTotalPrice(items) { + let total = 0; + items.forEach((item) => { + total += item.price; + }); + return total.toFixed(2); +} + +const shoppingCart = [ + { name: 'Laptop', price: 999.99 }, + { name: 'Smartphone', price: '599.99' }, + { name: 'Headphones', cost: 199.99 }, +]; + +const totalPrice = calculateTotalPrice(shoppingCart); +console.log('Total Price:', totalPrice); + +function displayUserProfile(user) { + console.log(`Name: ${user.name}`); + console.log(`Age: ${user.age}`); + console.log(`Email: ${user.email.toLowerCase()}`); +} + +const userProfile = { + name: 'Sarah', + age: 'twenty-five', + email: 'SARAH@EXAMPLE.COM', +}; + +displayUserProfile(userProfile); + +function getFirstItemName(items) { + return items[0].name.toUpperCase(); +} + +console.log('First Item:', getFirstItemName(shoppingCart)); // => LAPTOP + +const numberList = '1,2,3,4,5'; +const sum = numberList.reduce((acc, num) => acc + Number(num), 0); +console.log('Sum:', sum); // => 15 diff --git a/06_js-debug/uebungen/uebungen-01-10-js-debug.zip b/06_js-debug/uebungen/uebungen-01-10-js-debug.zip new file mode 100644 index 0000000000000000000000000000000000000000..92d35b1a27ce1ddf06f0932f4110474d0c49ccb7 GIT binary patch literal 16435 zcmeHubySsG(Dy;QyQRAu>5@hyMN;w*l2Ve=NK1$cNQ#t%fOJSBAV?@kmkLNLN(lO% zM=$Fhjt9K&THjskTX(&n{QjEy#nH z&(y-s!V~Oz)7-(`!^wun!wVCHfb<0c1p4{kuIOTeP?e5?uPZ|q@YMV%4-JF{a(44D zf|hq4t~@&@E3g;0t-GTGJjw00w086mskD&wIN8yDk{7Rgc1g#$-Ik!>^Pm=436*Un z76ur**q^T}E6T6B(@HeyU3GT<&DniA^@nf!dao%A9c|vkl~UOlTAJ*c-W?~Rr|i4Y z*MCcfpV-Gycl`!tOKkl9c%iNSG0!e6mJtkrEVsw)R~Ea-DTe>5Lo ztT?N#L1Ku-EX*-A0xw_3i+K|~IiT=lD%ThaX-HQ@DU%Sih=-3D`Nsd-Q#%11FckqYcqNv?~qs7N!xQ3ZWUld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OLV?9aDA-TN8N4lAafT~w)36E;uQ z(2151+dpX}fP1`#F4{T?#>+Qm8S{o^IENgR3tj{>1{W43rKwbV#1_Al`1p~ucxQDC z`$zO>)VG^cR}RIS59<6P%0{fnxt+>-CKHisE!SpKyCaIVzuQh}5Dr zBhQ9Jimz7JvGwq2W_Ng8q+BfL#EhB#F5(^}P+NZ2CI%s9W^<^h{EBv4^WE(ZZ$zMm z-Skiai~C#P!d2%%MA*KlJ>uIHn2-*XXBrc`vK$cU7qP>*zE#hp}l-E zvUf30c=^vmjW7-Y+zUH_Knk_-b=iAZz{cT@A;61pVD^#QQJ-Y^kD>06hrh3NC({q33w9wxxu612AfOrS6PsGtPr z2BA~H75u*g1lT(?ASe0c^?A4|&O`&&2tWfg8Z0M_*rGat#&2%=0~FB804QMl>?boM zl^QSyUb7t@8ow^m{w^wjt2F4#kCPd)ajNXI0Rb-7pfLw5fCl7bhUn3qX2F@5z?uRm zfyU%yhIr7QzyzMZ{s0TKJ^&WjcHBu==otW`;PvF-!2&empdAJz33QM2BrKk%%03$w zSmFXKI31QQ=F==V6Bbxg041lx@}A`cEb#pG2Uwu>0kFXKA&8(-b6qx(6)@`eW&}J? zfDQySC_n=ex-mozB{?_f-6@jKh6HFwLhAr_4-LslcC_Yzzxy)*fi(kA0SyT22{S@C zPXO|}r~Uv3v^D?^*aiS}DY`Dp%>^;&w=MuYFo2^!w4(sI(2k-!VZ|-Da?f-VJO$8h zVm_fDg&W#Uzgh4HC&B6hnh(&&Ns1G? Type Error +
diff --git a/06_js-debug/unterricht/tag46/04_error-types/04_type-error.js b/06_js-debug/unterricht/tag46/04_error-types/04_type-error.js new file mode 100644 index 0000000..18f8966 --- /dev/null +++ b/06_js-debug/unterricht/tag46/04_error-types/04_type-error.js @@ -0,0 +1,12 @@ +"use strict"; +{ + function greet(name) { + console.log('Hello, ' + name); + } + function displayCar(car) { + console.log('Brand: ' + car.brand + ', Model: ' + car.model); + } + const myCar = { name: 'Toyota', model: 'Camry' }; + greet(42); // => TypeError: Argument of type 'number' is not assignable to parameter of type 'string' + displayCar(myCar); // => TypeError: Argument of type '{ name: string; model: string; }' is not assignable to parameter of type 'Car'. Property 'brand' is missing in type '{ name: string; model: string; }' but required in type 'Car'. +} diff --git a/06_js-debug/unterricht/tag46/04_error-types/04_type-error.ts b/06_js-debug/unterricht/tag46/04_error-types/04_type-error.ts new file mode 100644 index 0000000..7d3eb7d --- /dev/null +++ b/06_js-debug/unterricht/tag46/04_error-types/04_type-error.ts @@ -0,0 +1,23 @@ +{ + interface Car { + brand: string; + model: string; + } + + function greet(name: string) { + console.log('Hello, ' + name); + } + + function displayCar(car: Car) { + console.log('Brand: ' + car.brand + ', Model: ' + car.model); + } + + const myCar = { name: 'Toyota', model: 'Camry' }; + + // greet(42); // => TypeError: Argument of type 'number' is not assignable to parameter of type 'string' + + greet('11'); + + // displayCar(myCar); // => TypeError: Argument of type '{ name: string; model: string; }' is not assignable to parameter of type 'Car'. Property 'brand' is missing in type '{ name: string; model: string; }' but required in type 'Car'. + displayCar({ brand: 'Honda', model: 'E' }); +} diff --git a/06_js-debug/unterricht/tag46/04_error-types/package-lock.json b/06_js-debug/unterricht/tag46/04_error-types/package-lock.json new file mode 100644 index 0000000..ff8c471 --- /dev/null +++ b/06_js-debug/unterricht/tag46/04_error-types/package-lock.json @@ -0,0 +1,390 @@ +{ + "name": "04_error-types", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "04_error-types", + "version": "1.0.0", + "devDependencies": { + "typescript": "^7.0.2" + } + }, + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc" + }, + "engines": { + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" + } + } + } +} diff --git a/06_js-debug/unterricht/tag46/04_error-types/package.json b/06_js-debug/unterricht/tag46/04_error-types/package.json new file mode 100644 index 0000000..3e9dc7e --- /dev/null +++ b/06_js-debug/unterricht/tag46/04_error-types/package.json @@ -0,0 +1,15 @@ +{ + "name": "04_error-types", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "npx tsc 04_type-error.ts" + }, + "keywords": [], + "type": "commonjs", + "devDependencies": { + "typescript": "^7.0.2" + } +} diff --git a/06_js-debug/unterricht/tag46/05_logical-error/logical-error.html b/06_js-debug/unterricht/tag46/05_logical-error/logical-error.html new file mode 100644 index 0000000..84a33e1 --- /dev/null +++ b/06_js-debug/unterricht/tag46/05_logical-error/logical-error.html @@ -0,0 +1,135 @@ + + + + + + Logical Error + + + + +
+
+

Logical Error

+
+
+ + +