#learnts search results

#learnTS 10. UTILITY TYPES contd The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch There are 13 of them listed. Bookmark so you don't forget😌 Use when needed. Use #learnTS to learn what TS is about🧵

justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵

#learnTS 3. ANY DATATYPE I avoid "any" datatype What about when you use libraries that don't have type definitions ? Tomorrow we will see about that

justsa_rah's tweet image. #learnTS

3. ANY DATATYPE

I avoid "any" datatype

What about when you use libraries that don't have type definitions ?

Tomorrow we will see about that
justsa_rah's tweet image. #learnTS

3. ANY DATATYPE

I avoid "any" datatype

What about when you use libraries that don't have type definitions ?

Tomorrow we will see about that

#learnTS 4. UNKNOWN TYPE When dealing with a library with type not defined, you can use "unknown" type instead of "any" A better alternative, in my opinion 😊

justsa_rah's tweet image. #learnTS

4. UNKNOWN TYPE

When dealing with a library with type not defined,  you can use "unknown" type instead of "any"

A better alternative, in my opinion 😊
justsa_rah's tweet image. #learnTS

4. UNKNOWN TYPE

When dealing with a library with type not defined,  you can use "unknown" type instead of "any"

A better alternative, in my opinion 😊

#learnTS 7. TYPE(S) IN TYPESCRIPT If this is confusing, use the hashtag to see where I'm coming from(previous posts). Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types

justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types

#learnTS 1. TYPESCRIPT BASIC TYPES First, let's look at type annotations in Typescript: Implicit and explicit type annotations. We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵

justsa_rah's tweet image. #learnTS
1. TYPESCRIPT BASIC TYPES

First, let's look at type annotations in Typescript: 
Implicit and explicit type annotations.

We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵
justsa_rah's tweet image. #learnTS
1. TYPESCRIPT BASIC TYPES

First, let's look at type annotations in Typescript: 
Implicit and explicit type annotations.

We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵

#learnTS 2.. TYPE ANNOTATIONS IN TYPESCRIPT Implicit type annotation === inference It is a very important concept in Typescript, where it guesses the variable type based on your input. For both, the types assigned to a variable, function, parameter, etc, must be consistent.

justsa_rah's tweet image. #learnTS
2.. TYPE ANNOTATIONS IN TYPESCRIPT 

Implicit type annotation === inference 

It is a very important concept in Typescript, where it guesses the variable type based on your input.

For both, the types assigned to a variable, function, parameter, etc, must be consistent.

Back to my roots😅 #learnTS 12. OPTIONAL VS DEFAULT PARAMETERS Adding "?" after a parameter makes it optional, In the first image with greet("Sarah") the value of age is undefined. Note that optional parameters must always come after required ones, why? Scroll with me

justsa_rah's tweet image. Back to my roots😅 
#learnTS

12.  OPTIONAL VS DEFAULT PARAMETERS

Adding "?" after a parameter makes it optional, 
In the first image with greet("Sarah") the value of age is undefined.

Note that optional parameters must always come after required ones, why?

Scroll with me
justsa_rah's tweet image. Back to my roots😅 
#learnTS

12.  OPTIONAL VS DEFAULT PARAMETERS

Adding "?" after a parameter makes it optional, 
In the first image with greet("Sarah") the value of age is undefined.

Note that optional parameters must always come after required ones, why?

Scroll with me

#learnTS 5. NEVER TYPE Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type. I was able to assign it values because a. It wasn't typescript b. noImplicitAny : true

justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true

#learnTS 6. UNION ( | ) Think of it like the "or logical operation" but for types. It allows multiple valid types. The type keyword lets you customise types. The autocomplete feature of typescript is seen when types are declared. Will talk more about types tomorrow.

justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.
justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.
justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.

Will get better at this 😊 Taking my building in public to the next level, I'm coming full force 📌 I won't just make videos, I will tweet, drop challenges, etc I'll use #learnTS for my typescript journey Not all heroes wear cape, @Pallojnrr Thanks for the confidence boost


Thank you for the birthday wishes yesterday 🥹 #learnTS 8. INTERFACE IN TS Interface does the same thing as type but in a different format It is defined as an object. All properties must be used and types must match the said properties.

justsa_rah's tweet image. Thank you for the birthday wishes yesterday 🥹

#learnTS

8. INTERFACE IN TS

Interface does the same thing as type but in a different format
It is defined as an object.

All properties must be used and types must match the said properties.
justsa_rah's tweet image. Thank you for the birthday wishes yesterday 🥹

#learnTS

8. INTERFACE IN TS

Interface does the same thing as type but in a different format
It is defined as an object.

All properties must be used and types must match the said properties.

#learnTS 9. UTILITY TYPES This is a concise way of creating a new type from an already existing type or interface In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵

justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵

The correct answer is any Thank you all for participating 😊 Thursdays will be our quiz day 🥳 #learnTS

#learnTS Quiz Timee 📢 let data; What type will Typescript assign to data by default? The answer highlights what will be discussed tomorrow



#learnTS 11. TYPES VS INTERFACE When do you decide which to use, or better yet do you combine them? Lets dig deep into the differences Why? Their use-case may be similar but the syntax are definitely not 🧵 Bookmark so you don't forget😌


#learnTS Quiz Timee 📢 let data; What type will Typescript assign to data by default? The answer highlights what will be discussed tomorrow


#learnTS Quizzz 😏 In TS, which is TRUE for default values? It can be assigned: A) in an interface for its properties B) only in functions, not in types or interfaces. C) by Generic type parameters to provide "defaults" in types and interfaces. D) B and C are correct.


#learnTS Quiz dayyyy 🥳 type ID = number | string type Point = [number, number] What is Point?

Array %62.5
Tuple %37.5

8 vote · Final results


Love the determination, keep it up👏🏾 #learnTs


#learnTS When using typescript with node.js, have you ever used hydrated-document before? It is something I haven't really seen talked about I'm thinking of writing a medium article on it. It is a cleaner way to extend your document types in your schema PS: I use mongo dB


#learnTS Quizzz 😏 In TS, which is TRUE for default values? It can be assigned: A) in an interface for its properties B) only in functions, not in types or interfaces. C) by Generic type parameters to provide "defaults" in types and interfaces. D) B and C are correct.


Back to my roots😅 #learnTS 12. OPTIONAL VS DEFAULT PARAMETERS Adding "?" after a parameter makes it optional, In the first image with greet("Sarah") the value of age is undefined. Note that optional parameters must always come after required ones, why? Scroll with me

justsa_rah's tweet image. Back to my roots😅 
#learnTS

12.  OPTIONAL VS DEFAULT PARAMETERS

Adding "?" after a parameter makes it optional, 
In the first image with greet("Sarah") the value of age is undefined.

Note that optional parameters must always come after required ones, why?

Scroll with me
justsa_rah's tweet image. Back to my roots😅 
#learnTS

12.  OPTIONAL VS DEFAULT PARAMETERS

Adding "?" after a parameter makes it optional, 
In the first image with greet("Sarah") the value of age is undefined.

Note that optional parameters must always come after required ones, why?

Scroll with me

#learnTS 11. TYPES VS INTERFACE When do you decide which to use, or better yet do you combine them? Lets dig deep into the differences Why? Their use-case may be similar but the syntax are definitely not 🧵 Bookmark so you don't forget😌


#learnTS 10. UTILITY TYPES contd The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch There are 13 of them listed. Bookmark so you don't forget😌 Use when needed. Use #learnTS to learn what TS is about🧵

justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵

#learnTS When using typescript with node.js, have you ever used hydrated-document before? It is something I haven't really seen talked about I'm thinking of writing a medium article on it. It is a cleaner way to extend your document types in your schema PS: I use mongo dB


#learnTS Quizz dayy🥳📢 What does infer help you do in TypeScript? A. Infer the type of an object at runtime B. Create conditional types that extract inner types C. Automatically assign default values to types D. Declare types in JSX files Think twice before answering 🥂


#learnTS Quiz dayyyy 🥳 type ID = number | string type Point = [number, number] What is Point?

Array %62.5
Tuple %37.5

8 vote · Final results


#learnTS 9. UTILITY TYPES This is a concise way of creating a new type from an already existing type or interface In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵

justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵

Thank you for the birthday wishes yesterday 🥹 #learnTS 8. INTERFACE IN TS Interface does the same thing as type but in a different format It is defined as an object. All properties must be used and types must match the said properties.

justsa_rah's tweet image. Thank you for the birthday wishes yesterday 🥹

#learnTS

8. INTERFACE IN TS

Interface does the same thing as type but in a different format
It is defined as an object.

All properties must be used and types must match the said properties.
justsa_rah's tweet image. Thank you for the birthday wishes yesterday 🥹

#learnTS

8. INTERFACE IN TS

Interface does the same thing as type but in a different format
It is defined as an object.

All properties must be used and types must match the said properties.

#learnTS 7. TYPE(S) IN TYPESCRIPT If this is confusing, use the hashtag to see where I'm coming from(previous posts). Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types

justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types

#learnTS 6. UNION ( | ) Think of it like the "or logical operation" but for types. It allows multiple valid types. The type keyword lets you customise types. The autocomplete feature of typescript is seen when types are declared. Will talk more about types tomorrow.

justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.
justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.
justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.

#learnTS Quiz dayyy 🥳 Which is risky and can break your app silently


#learnTS 5. NEVER TYPE Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type. I was able to assign it values because a. It wasn't typescript b. noImplicitAny : true

justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true

#learnTS 4. UNKNOWN TYPE When dealing with a library with type not defined, you can use "unknown" type instead of "any" A better alternative, in my opinion 😊

justsa_rah's tweet image. #learnTS

4. UNKNOWN TYPE

When dealing with a library with type not defined,  you can use "unknown" type instead of "any"

A better alternative, in my opinion 😊
justsa_rah's tweet image. #learnTS

4. UNKNOWN TYPE

When dealing with a library with type not defined,  you can use "unknown" type instead of "any"

A better alternative, in my opinion 😊

#learnTS 3. ANY DATATYPE I avoid "any" datatype What about when you use libraries that don't have type definitions ? Tomorrow we will see about that

justsa_rah's tweet image. #learnTS

3. ANY DATATYPE

I avoid "any" datatype

What about when you use libraries that don't have type definitions ?

Tomorrow we will see about that
justsa_rah's tweet image. #learnTS

3. ANY DATATYPE

I avoid "any" datatype

What about when you use libraries that don't have type definitions ?

Tomorrow we will see about that

The correct answer is any Thank you all for participating 😊 Thursdays will be our quiz day 🥳 #learnTS

#learnTS Quiz Timee 📢 let data; What type will Typescript assign to data by default? The answer highlights what will be discussed tomorrow



#learnTS Quiz Timee 📢 let data; What type will Typescript assign to data by default? The answer highlights what will be discussed tomorrow


#learnTS 2.. TYPE ANNOTATIONS IN TYPESCRIPT Implicit type annotation === inference It is a very important concept in Typescript, where it guesses the variable type based on your input. For both, the types assigned to a variable, function, parameter, etc, must be consistent.

justsa_rah's tweet image. #learnTS
2.. TYPE ANNOTATIONS IN TYPESCRIPT 

Implicit type annotation === inference 

It is a very important concept in Typescript, where it guesses the variable type based on your input.

For both, the types assigned to a variable, function, parameter, etc, must be consistent.

#learnTS 1. TYPESCRIPT BASIC TYPES First, let's look at type annotations in Typescript: Implicit and explicit type annotations. We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵

justsa_rah's tweet image. #learnTS
1. TYPESCRIPT BASIC TYPES

First, let's look at type annotations in Typescript: 
Implicit and explicit type annotations.

We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵
justsa_rah's tweet image. #learnTS
1. TYPESCRIPT BASIC TYPES

First, let's look at type annotations in Typescript: 
Implicit and explicit type annotations.

We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵

Love the determination, keep it up👏🏾 #learnTs


Be comfortable with #choices when presented or unchartered. Hard, colourful or not... #learnts

drostontang's tweet image. Be comfortable with #choices when presented or unchartered. Hard, colourful or not... #learnts

#learnTS 3. ANY DATATYPE I avoid "any" datatype What about when you use libraries that don't have type definitions ? Tomorrow we will see about that

justsa_rah's tweet image. #learnTS

3. ANY DATATYPE

I avoid "any" datatype

What about when you use libraries that don't have type definitions ?

Tomorrow we will see about that
justsa_rah's tweet image. #learnTS

3. ANY DATATYPE

I avoid "any" datatype

What about when you use libraries that don't have type definitions ?

Tomorrow we will see about that

#learnTS 10. UTILITY TYPES contd The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch There are 13 of them listed. Bookmark so you don't forget😌 Use when needed. Use #learnTS to learn what TS is about🧵

justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵
justsa_rah's tweet image. #learnTS

10. UTILITY TYPES contd

The images show the different utility types used in TS. Sometimes, you don't need to create a brand new type from scratch

There are 13 of them listed. Bookmark so you don't forget😌

Use when needed. Use #learnTS to learn what TS is about🧵

#learnTS 4. UNKNOWN TYPE When dealing with a library with type not defined, you can use "unknown" type instead of "any" A better alternative, in my opinion 😊

justsa_rah's tweet image. #learnTS

4. UNKNOWN TYPE

When dealing with a library with type not defined,  you can use "unknown" type instead of "any"

A better alternative, in my opinion 😊
justsa_rah's tweet image. #learnTS

4. UNKNOWN TYPE

When dealing with a library with type not defined,  you can use "unknown" type instead of "any"

A better alternative, in my opinion 😊

#learnTS 5. NEVER TYPE Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type. I was able to assign it values because a. It wasn't typescript b. noImplicitAny : true

justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true
justsa_rah's tweet image. #learnTS
5. NEVER TYPE

Before I knew anything about typescript, when I was using a React useState hook with a default value of empty array, typescript normally infers it to be a never type.

I was able to assign it values because a. It wasn't typescript 
b. noImplicitAny : true

#learnTS 6. UNION ( | ) Think of it like the "or logical operation" but for types. It allows multiple valid types. The type keyword lets you customise types. The autocomplete feature of typescript is seen when types are declared. Will talk more about types tomorrow.

justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.
justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.
justsa_rah's tweet image. #learnTS

6. UNION ( | ) 
Think of it like the "or logical operation" but for types. It allows multiple valid types.

The type keyword lets you customise types.
The autocomplete feature of typescript is seen when types are declared.

Will talk more about types tomorrow.

#learnTS 7. TYPE(S) IN TYPESCRIPT If this is confusing, use the hashtag to see where I'm coming from(previous posts). Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types

justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types
justsa_rah's tweet image. #learnTS

7. TYPE(S) IN TYPESCRIPT 

If this is confusing, use the hashtag to see where I'm coming from(previous  posts).

Type is a very important concept in ts. It's very broad. Hovering over your code is good actually to confirm types

#learnTS 1. TYPESCRIPT BASIC TYPES First, let's look at type annotations in Typescript: Implicit and explicit type annotations. We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵

justsa_rah's tweet image. #learnTS
1. TYPESCRIPT BASIC TYPES

First, let's look at type annotations in Typescript: 
Implicit and explicit type annotations.

We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵
justsa_rah's tweet image. #learnTS
1. TYPESCRIPT BASIC TYPES

First, let's look at type annotations in Typescript: 
Implicit and explicit type annotations.

We are going to be using explicit type annotation to aid understanding, i.e., we will explicitly tell Typescript what each variable should be🧵

#learnTS 2.. TYPE ANNOTATIONS IN TYPESCRIPT Implicit type annotation === inference It is a very important concept in Typescript, where it guesses the variable type based on your input. For both, the types assigned to a variable, function, parameter, etc, must be consistent.

justsa_rah's tweet image. #learnTS
2.. TYPE ANNOTATIONS IN TYPESCRIPT 

Implicit type annotation === inference 

It is a very important concept in Typescript, where it guesses the variable type based on your input.

For both, the types assigned to a variable, function, parameter, etc, must be consistent.

Thank you for the birthday wishes yesterday 🥹 #learnTS 8. INTERFACE IN TS Interface does the same thing as type but in a different format It is defined as an object. All properties must be used and types must match the said properties.

justsa_rah's tweet image. Thank you for the birthday wishes yesterday 🥹

#learnTS

8. INTERFACE IN TS

Interface does the same thing as type but in a different format
It is defined as an object.

All properties must be used and types must match the said properties.
justsa_rah's tweet image. Thank you for the birthday wishes yesterday 🥹

#learnTS

8. INTERFACE IN TS

Interface does the same thing as type but in a different format
It is defined as an object.

All properties must be used and types must match the said properties.

#learnTS 9. UTILITY TYPES This is a concise way of creating a new type from an already existing type or interface In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵

justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵
justsa_rah's tweet image. #learnTS

9. UTILITY TYPES

This is a concise way of creating a new type from an already existing type or interface

In the pictures below, I use Pick as my example today. The first parameter is the origin type or interface that you want to copy and the second parameter 🧵

Back to my roots😅 #learnTS 12. OPTIONAL VS DEFAULT PARAMETERS Adding "?" after a parameter makes it optional, In the first image with greet("Sarah") the value of age is undefined. Note that optional parameters must always come after required ones, why? Scroll with me

justsa_rah's tweet image. Back to my roots😅 
#learnTS

12.  OPTIONAL VS DEFAULT PARAMETERS

Adding "?" after a parameter makes it optional, 
In the first image with greet("Sarah") the value of age is undefined.

Note that optional parameters must always come after required ones, why?

Scroll with me
justsa_rah's tweet image. Back to my roots😅 
#learnTS

12.  OPTIONAL VS DEFAULT PARAMETERS

Adding "?" after a parameter makes it optional, 
In the first image with greet("Sarah") the value of age is undefined.

Note that optional parameters must always come after required ones, why?

Scroll with me

#codecademy #typescript #learnts #ASPNETCore Вот и окончил курс по TypeScript от Codecademy. ASP.Net Core ты следующий 😎

d_kaygorodov's tweet image. #codecademy #typescript #learnts #ASPNETCore
Вот и окончил курс по TypeScript от Codecademy. ASP.Net Core ты следующий 😎

Loading...

Something went wrong.


Something went wrong.


United States Trends