DEV Community

Cover image for type variables in typescript
cem kaan kosali
cem kaan kosali

Posted on • Updated on


type variables in typescript

  1. I watched 20 minutes of Data structures. I finished Priority Queue.
  2. I've tried some different layouts in nativescript-vue in
  3. I wrote a little bit more on functional typescript.

May be I will use StackLayout instead of GridLayout

        <StackLayout orientation="horizontal" backgroundColor="lightgray">
            <Label v-for="n in item.totalLabelsCount" :text=""
                width="30" height="150" backgroundColor="white"
                class="border" />
Enter fullscreen mode Exit fullscreen mode

I am trying to come with an idea about how to explain type variables in Typescript

Did you know there are type variables in typescript? You don't need to know type of a result from a function. You can just use a variable for whatever this type will be. Cool right?

function identity<T>(arg: T): T {
    return arg;
Enter fullscreen mode Exit fullscreen mode

Please check out:


Top comments (0)

An Animated Guide to Node.js Event Loop

>> Check out this classic DEV post <<