This video is available to students only

What is TypeScript? TypeScript vs JavaScript for Development

JavaScript is considered a weakly typed language. In this lesson, we'll go through a simple example of why that can be an issue in development and where TypeScript falls in the picture.

📝 This lesson's quiz can be found -

here

.


🗒️ Solutions for this lesson's quiz can be found -

here

.

JavaScript is considered a weakly typed language which means that in JavaScript, we have the ability to assign one data type to a variable and later on assign another data type to that same variable.

Let's see an example of this in our index.js file. We'll look to replicate what we've done before by creating two variables, one and two, and attempt to show the summation of these two variables.

In the src/index.js of our server project, we'll create constant variables labeled one and two and provide numerical values of 1 and 2 respectively.

In the callback function of our app.get() method for the index route, we'll send an interpolated string that says 1 plus 2 is equal to the sum of the variables one and two.

When we launch our app in http://localhost:9000/, we'll see an output of 1 + 2 = 3.

This lesson preview is part of the TinyHouse: A Fullstack React Masterclass with TypeScript and GraphQL course and can be unlocked immediately with a single-time purchase. Already have access to this course? Log in here.

Unlock This Course

Get unlimited access to TinyHouse: A Fullstack React Masterclass with TypeScript and GraphQL with a single-time purchase.

Thumbnail for the \newline course TinyHouse: A Fullstack React Masterclass with TypeScript and GraphQL