From the course: React: Using TypeScript (2019)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Other complex types
- [Instructor] We've explored some basic types, now let's go and take a look at other complex types. First thing we're going to do is erase all this so we can get some space to work here, so if you want to take a look at these later on, you can take a look at the exercise files. So, the first thing we're going to do is aTuple, so I'm going to first put the syntax and then explain what it is. So, let's go and do a let aTuple and then we'll declare it with an array and then initialize it with some values. So, basically aTuple is a type of array that you can insert multiple types and let me just add some stuff here to make a little bit more sense. So, in this type of array, you can actually have more than one type. So, typically in JavaScript you can do whatever you want in an array, so you can add anything you want, however, in TypeScript you have to define it first and then the array has to be exactly what that declaration is, so for example, if you declare an array as a string, all of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Introduction to TypeScript with React2m 17s
-
(Locked)
Basic types4m 22s
-
(Locked)
Other complex types4m 53s
-
(Locked)
Functional/stateless component intro2m 23s
-
(Locked)
Functional/stateless component syntax3m 37s
-
(Locked)
Class/stateful component intro1m 59s
-
(Locked)
Class/stateful component syntax3m 42s
-
-
-
-