DEV Community

loading...
Cover image for Typescript vs Javascript

Typescript vs Javascript

kpiteng
CEO w KPITENG | Digital Transformation | Web, Mobile, AR/VR, AI/ML, Blockchain App Development | UI/UX Design, IoT Solutions In India, USA
Originally published at kpiteng.com ・2 min read

TypeScript is a programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language. Current Stable release: 4.2.3 / 5 March 2021. It has extensions: ts,.tsx.

TypeScript used to develop JavaScript applications for both client-side and server-side execution. Typescipt describe the shape of an object, also validate that your code is working correctly. All valid JavaScript code is also TypeScript code.

TypeScript code is transformed into JavaScript code via the TypeScript compiler or Babel. This JavaScript is clean, simple code which runs anywhere JavaScript runs: In a browser, on Node.JS or in your apps.

Typescript support in Visual Studio, Visual Studio Code, Nova, Atom, Sublime Text, Emacs, Vim, WebStorm and Eclipse. Provide wide range of accessibility & usablity.

Typescript is combination of static type checking with intelligent code completion provides a significant boost in developer productivity.

TypeScript vs JavaScript

Type
TS: TS is strongly type object oriented compiled langauge.
JS: Javascript is a light weight, interpreted programming language.

Design & Developed by
TS: Anders Heijsberg at Microsoft
JS: J Brendan Eich at Netscape Communications Coropration, Mozilla Foundation, ECMA International

Light/Heavy Weight
TS: Heavy Weighted interpreted programming language
JS - Light weighted, design for development of large application and trans compile to JS

Client Side/Server Side
TS: Specially used in Client Side
JS: Both client side & server side

File Extension
TS: .ts, .tsx
JS: .js, .jsx

Syntax
TS: Modules, Functions, Variable, Statement & Expression, Comments
JS: All Statement are written within Script tag, tell browser to start interpreting text between script tag

Benefits
TS: Static Typing, Better Choice Of large Coding Projects, Better For Collaboration - Type Safetly, Warning, Options, Required, Better Productivity, ECMA 6 code, Dynamic Typing, Auto Compilation are help developers to boost their productivity
JS: Huge active community, Supported Native Browsers, While for TS will first complied and convert to js, which is extra step, More flexibility

Want to start with Typescript, Let's start! Join Us www.kpiteng.com

Connect Us -

KPITENG
Digital Transformation Service Provider
www.kpiteng.com
hello@kpiteng.com

Discussion (1)

Collapse
arvindpdmn profile image
Arvind Padmanabhan

Lot of legacy JS might need to be migrated to TS. This article may help: devopedia.org/javascript-to-typesc...

Forem Open with the Forem app