programming:javascript:usage
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
programming:javascript:usage [2023/12/06 11:29] – ms | programming:javascript:usage [2023/12/06 11:50] (current) – ms | ||
---|---|---|---|
Line 40: | Line 40: | ||
console.log(objektEins); | console.log(objektEins); | ||
- | > {name: ' | + | > {name: 'Hans', nach-name: 'Wurst', alter: 27, geburtstag: {tag: 19, monat: 3, jahr: 1970}, wohnort: ' |
> Mainz | > Mainz | ||
</ | </ | ||
Line 50: | Line 50: | ||
console.log(objektEins); | console.log(objektEins); | ||
- | > {name: ' | + | > {name: 'Hans', nach-name: 'Wurst', alter: 27, geburtstag: {tag: 19, monat: 3, jahr: 1970}} |
+ | </ | ||
+ | Funktionen in Objekten -> Methoden | ||
+ | < | ||
+ | const objektEins = { | ||
+ | name: ' | ||
+ | alter: 27, | ||
+ | methodeEins: | ||
+ | console.log(' | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | console.log(objektEins); | ||
+ | console.log(objektEins.name); | ||
+ | console.log(objektEins.alter); | ||
+ | console.log(objektEins.methodeEins); | ||
+ | |||
+ | objektEins.methodeEins(); | ||
+ | |||
+ | > {name: ' | ||
+ | > Hans | ||
+ | > 27 | ||
+ | > ƒ funktionEins() { | ||
+ | console.log(' | ||
+ | } | ||
+ | > Funktion im Objekt | ||
+ | </ | ||
+ | < | ||
+ | console.log(typeof Math); | ||
+ | console.log(typeof Math.sin); | ||
+ | |||
+ | > object | ||
+ | > function | ||
</ | </ | ||
programming/javascript/usage.1701858563.txt.gz · Last modified: 2023/12/06 11:29 by ms