From c8a1f2d7f14f16ca241b52356fce28e117e740fa Mon Sep 17 00:00:00 2001 From: Philippe Torrel Date: Mon, 29 Jun 2026 15:04:39 +0200 Subject: [PATCH] --- 02_advanced/unterricht/tag11/01_objekte.html | 34 +++ .../unterricht/tag11/02_objekte-bsp.html | 238 ++++++++++++++++++ .../unterricht/tag11/03_objekte-mit-this.html | 143 +++++++++++ .../03_schnittstellenformate/persons.json | 14 ++ .../03_schnittstellenformate/persons.xml | 22 ++ .../tag11/04_object-keys-values-entries.html | 45 ++++ 6 files changed, 496 insertions(+) create mode 100644 02_advanced/unterricht/tag11/02_objekte-bsp.html create mode 100644 02_advanced/unterricht/tag11/03_objekte-mit-this.html create mode 100644 02_advanced/unterricht/tag11/03_schnittstellenformate/persons.json create mode 100644 02_advanced/unterricht/tag11/03_schnittstellenformate/persons.xml create mode 100644 02_advanced/unterricht/tag11/04_object-keys-values-entries.html diff --git a/02_advanced/unterricht/tag11/01_objekte.html b/02_advanced/unterricht/tag11/01_objekte.html index 1087979..32b8409 100644 --- a/02_advanced/unterricht/tag11/01_objekte.html +++ b/02_advanced/unterricht/tag11/01_objekte.html @@ -5,6 +5,7 @@ Object - object +
@@ -88,6 +89,39 @@ console.log(personObj.schiess()); console.log(personObj.age); // => 45 + + // ============================= + + const cssProp = 'border'; + const color = 'white'; + + const cssObj = { + 'background-color': '#555', + 'margin-top': '1rem', + border: '3px solid tomato', + // fontSize, // Uncaught ReferenceError: fontSize is not defined + // color: color, + color, // Kurzschreibweise seit ES6 - wenn Eigenschaft und Variable gleiche Bezeichnung besitzen + }; + + console.log(cssObj['background-color']); //=> '#555' + console.log(cssObj[cssProp]); //=> '3px solid tomato' + + console.log(cssObj.color); //=> 'white' + + // ========================= + + // document.querySelector('h1').style.color = cssObj.color; + // document.querySelector('h1').style.backgroundColor = cssObj['background-color']; + // document.querySelector('h1').style.padding = '1rem'; + // document.querySelector('h1').style.border = cssObj['border']; + + $('h1').css({ + color: 'white', + backgroundColor: '#555', + padding: '1rem', + border: '3px solid tomato', + }); diff --git a/02_advanced/unterricht/tag11/02_objekte-bsp.html b/02_advanced/unterricht/tag11/02_objekte-bsp.html new file mode 100644 index 0000000..b617c48 --- /dev/null +++ b/02_advanced/unterricht/tag11/02_objekte-bsp.html @@ -0,0 +1,238 @@ + + + + + + Objekte in JS - Beispiele + + + +
+
+

Objekte in JS - Beispiele

+
+
+
+ + + diff --git a/02_advanced/unterricht/tag11/03_objekte-mit-this.html b/02_advanced/unterricht/tag11/03_objekte-mit-this.html new file mode 100644 index 0000000..c568a58 --- /dev/null +++ b/02_advanced/unterricht/tag11/03_objekte-mit-this.html @@ -0,0 +1,143 @@ + + + + + + Object - object + + + + +
+
+

Objekt - object

+

+ Der + Object-Typ + repräsentiert einen von JavaScript's Datentypen. Er wird verwendet, um verschiedene Schlüsselkollektionen und + komplexere Entitäten zu speichern. Objekte können mit dem Object()-Konstruktor oder der + Objekt-Initialisierer-Syntax erstellt werden. +

+
+
+
+ + + diff --git a/02_advanced/unterricht/tag11/03_schnittstellenformate/persons.json b/02_advanced/unterricht/tag11/03_schnittstellenformate/persons.json new file mode 100644 index 0000000..b5b538b --- /dev/null +++ b/02_advanced/unterricht/tag11/03_schnittstellenformate/persons.json @@ -0,0 +1,14 @@ +[ + { + "firstName": "Max", + "lastName": "Mustermann", + "age": 38, + "hobbies": ["Tennis", "Schach"] + }, + { + "firstName": "Jane", + "lastName": "Doe", + "age": 24, + "hobbies": ["Zocken", "Tanzen"] + } +] diff --git a/02_advanced/unterricht/tag11/03_schnittstellenformate/persons.xml b/02_advanced/unterricht/tag11/03_schnittstellenformate/persons.xml new file mode 100644 index 0000000..53b1606 --- /dev/null +++ b/02_advanced/unterricht/tag11/03_schnittstellenformate/persons.xml @@ -0,0 +1,22 @@ + + + + + Max + Mustermann + 38 + + Tennis + Schach + + + + Jane + Doe + 24 + + Zocken + Tanzen + + + \ No newline at end of file diff --git a/02_advanced/unterricht/tag11/04_object-keys-values-entries.html b/02_advanced/unterricht/tag11/04_object-keys-values-entries.html new file mode 100644 index 0000000..3d49b71 --- /dev/null +++ b/02_advanced/unterricht/tag11/04_object-keys-values-entries.html @@ -0,0 +1,45 @@ + + + + + + Object Methoden - keys(), values(), entries() + + + +
+
+

Object Methoden - keys(), values(), entries()

+
+
+ + +