functies toegevoegt
This commit is contained in:
@@ -1,21 +1,28 @@
|
||||
# typescript funties
|
||||
|
||||
|
||||
* "let bruh;" met "let" declare je een variabel
|
||||
* ```"let bruh;"``` met "let" declare je een variabel
|
||||
* ```console.log("hi")``` nu kom er hi in je console terecht als je dit draait.
|
||||
|
||||
|
||||
```typescript
|
||||
let guess;
|
||||
|
||||
|
||||
guess = "blue";
|
||||
guess = 7;
|
||||
|
||||
```
|
||||
* door de vraagteken gaat de functie naar 'not ready' omdat er niks ingevult kan worden bij status
|
||||
```typescript
|
||||
function proclaim(status?: string) {
|
||||
console.log(`I'm ${status || 'not ready...'}`);
|
||||
}
|
||||
```
|
||||
|
||||
Een variabel kan alles zijn in typescript. Het is "any" je kan het later altijd een type geven
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
A-->B;
|
||||
A-->C;
|
||||
B-->D;
|
||||
C-->D;
|
||||
```
|
||||
er zijn 3 verschillende soorten datatypes
|
||||
* string
|
||||
* number
|
||||
* boolean
|
||||
|
||||
|
Reference in New Issue
Block a user