Cleanup
This commit is contained in:
parent
8468a75900
commit
7b48488204
16
workshop.md
16
workshop.md
|
|
@ -16,7 +16,9 @@ Endlich ruhig schlafen bei der Frontend-Entwicklung. 😴
|
|||
|
||||
# Was ist Typescript?
|
||||
|
||||
Zusatzinformationen über Typen für Javascript.
|
||||
* Erweitert Javascript
|
||||
* Fügt Typeninformationen in die Sprache ein
|
||||
* Daten und Datenfluss wird besser beschrieben
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -904,6 +906,18 @@ const number = {name: 'blarg'} as number;
|
|||
|
||||
## Deduktionsschwächen
|
||||
|
||||
```ts
|
||||
function inferBroken(str: string) {
|
||||
if (['Bernd', 'Margeret'].includes(str)) {
|
||||
const narrowed: 'Bernd'|'Margeret' = str;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Deduktionsschwächen
|
||||
|
||||
```ts
|
||||
function inferBroken(str: string) {
|
||||
if (['Bernd', 'Margeret'].includes(str)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user