functies toegevoegt

This commit is contained in:
sam
2023-09-13 17:57:46 +02:00
parent 19834c09a8
commit 6bf59daa49

View File

@@ -1,21 +1,28 @@
# typescript funties # 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 ```typescript
let guess; let guess;
guess = "blue"; guess = "blue";
guess = 7; 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 Een variabel kan alles zijn in typescript. Het is "any" je kan het later altijd een type geven
```mermaid er zijn 3 verschillende soorten datatypes
graph TD; * string
A-->B; * number
A-->C; * boolean
B-->D;
C-->D;
```