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
* "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