How Typescript Works with JavaScript: A Beginner's Guide

Typescript is actually a part of JavaScript not the other way around Atleast technically,Wait let me explain HOW TYPESCRIPT ACTUALLY RUNS💪 With the help of JavaScript we can create variables from getting elements and manipulating them, elements such as inputs with text, numbers, but variables are used to hold some sort of variable type such as string, numbers, But here is where it gets interesting, you need to manipulate this values held by the variables, so when you accidentally slice a number, why does your HTML turns blank or react turns red, You already know it, because of it “TYPE”. Meaning JavaScript already recognizes each and every value as it type based on how you previously stored it, that is why you use “typeof” and you get it variable type. HOW CAN I GET PREPARED, CAUSE IT ISN”T TYPESCRIPT SEASON FOR ME.😁 1. The display of pipe operator used in typescript when Hovering on a variable with dynamic value mostly when you use a tenary operator mode of condition. 2. When you hiver value passed from context it mostly show “const variable: any”(Typescript syntax). 3. After manipulating variable types with it compatible functions strings with slice(), always think if there is any point time, it might not be string e.g it’s initial point it might be undefined. 4. Be on the look out for error at every compile, it is better than the error looking for a place to be. 5. Typescript is basically a stretch of JavaScript allowing you to limit the value a particular variable type e.g (only strings) or range of variable types(string, number, undefined) a variable can accept. 6. Typescript tests your code at compile time and not at runtime. Thank you 😊 #Typescript #Javascript #WebDevelopment #Softwareengineering #Technology #Learning

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories