# type annotation

{% tabs %}
{% tab title="type annotation" %}

```typescript
// ⭐️ type annotation
//        ╭──────╮
let myName: string = "Alice";                   // on variable
//                 ╭──────╮
function greet(name: string) { log(name) }      // on parameter
//                  ╭──────╮
function twentySix(): number { return 26; }     // on return type
```

{% endtab %}

{% tab title="📗 參考" %}

* 📘 [Type Annotations](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-annotations-on-variables)
  {% endtab %}
  {% endtabs %}
