DEV Community

Cover image for TypeScript Journey: A Beginner's Journey into Typed JavaScript
Amrita-padhy
Amrita-padhy

Posted on

2

TypeScript Journey: A Beginner's Journey into Typed JavaScript

TypeScript: An Overview
TypeScript is a programming language built on top of JavaScript. Every JavaScript file is a valid TypeScript file, but TypeScript adds some powerful features that enhance the robustness and maintainability of applications.

What is TypeScript?
TypeScript addresses the shortcomings of JavaScript by introducing features like static typing. In static typing, variables can be declared with a specific type, such as a number or string. Unlike dynamic typing found in languages like JavaScript, TypeScript provides type checking at compile time.

Image description

Benefits of TypeScript

Image description

  • Static Typing: Enables catching type-related errors early in the development process.
  • Code Compilation: TypeScript code is compiled into JavaScript, making it compatible with all browsers.
  • Refactoring: Easier code refactoring due to the availability of type information.
  • Short-hand Notation: Provides concise syntax for common patterns, improving code readability and maintainability.

Drawbacks of TypeScript

  • Compilation Step: Requires a compilation step before running the code, adding an extra layer of complexity to the development process.
  • Discipline in Coding: Developers need to adhere to TypeScript's typing rules and guidelines, which may require additional effort and discipline.

Compilation Process

To use TypeScript in a web application, the TypeScript code must be transpiled into JavaScript using a TypeScript compiler. This transpilation process ensures that the resulting JavaScript code is compatible with all browsers.

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay