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:30] – ms | programming:javascript:usage [2023/12/06 11:50] (current) – ms | ||
---|---|---|---|
Line 51: | Line 51: | ||
> {name: ' | > {name: ' | ||
+ | </ | ||
+ | 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.1701858620.txt.gz · Last modified: 2023/12/06 11:30 by ms