Introducing TypeScript…

What is it?

Dynamic typing vs. Static type checking…

Benefits?

  • TypeScript can easily adapt to existing JavaScript files. Meaning you do not have to start using TypeScript in every file or right off the bat in a program but can gradually add it in here and there.
  • TypeScript offers all of JavaScript’s features as well as an additional layer of TypeScript type system.
  • Like we mentioned above, your existing JS code is TS so go on with loving your JavaScript language!
  • TypeScript helps predict behavior of values so we can avoid a lot of hidden errors!

How to use?

here is a simple object …
here is how we can use TypeScript, we create an interface declaration to explicitly describe this object’s shapes
now we reference our interface by using the syntax like : TypeName after a variable declaration
JS && TS support classes and object-oriented programming (my fellow react lovers can implement TS in their programs as well!)

Conclusion…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
syd

syd

software engineer. red wine addict. obsessed with vintage cars and jewelry.