What is TypeScript ? - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
What is TypeScript ?

What is TypeScript ?

What is TypeScript ?
TypeScript is a superset of JavaScript which primarily provides optional static typing, classes and interfaces. One of the big benefits is to enable IDEs to provide a richer environment for spotting common errors as you type the code.
What is TypeScript?

 For a large JavaScript project, adopting TypeScript might result in more robust software, while still being deployable where a regular JavaScript application would run.
It is open source, but you only get the clever Intellisense as you type if you use a supported IDE. Initially, this was only Microsoft's Visual Studio (also noted in blog post from Miguel de Icaza). These days, other IDEs offer TypeScript support too.
Are there other technologies like it?
There's CoffeeScript, but that really serves a different purpose. IMHO, CoffeeScript provides readability for humans, but TypeScript also provides deep readability for tools through its optional static typing (see this recent blog postfor a little more critique). There's also Dart but that's a full on replacement for JavaScript (though it can produce JavaScript code)
Example
As an example, here's some TypeScript (you can play with this in the TypeScript Playground)
  1. class Greeter {
  2. greeting: string;
  3. constructor (message: string) {
  4. this.greeting = message;
  5. }
  6. greet() {
  7. return "Hello, " + this.greeting;
  8. }
  9. }
And here's the JavaScript it would produce
  1. var Greeter = (function () {
  2. function Greeter(message) {
  3. this.greeting = message;
  4. }
  5. Greeter.prototype.greet = function () {
  6. return "Hello, " + this.greeting;
  7. };
  8. return Greeter;
  9. })();
Notice how the TypeScript defines the type of member variables and class method parameters. This is removed when translating to JavaScript, but used by the IDE and compiler to spot errors, like passing a numeric type to the constructor.
It's also capable of inferring types which aren't explicitly declared, for example, it would determine the greet() method returns a string.
Here is the list of all TypeScript tutorial:
TypeScript tutorial:
  • TypeScript Overview tutorial.
    What is typescript. Typescript advantages and features tutorial.
  • Typescript vs Javascript tutorial.
    Differences between javascript and typescript (typescript vs javascript).
  • Typescript let vs var tutorial.
    The var vs let typescript. Difference between var and let in javascript or typescript. Redeclaration and scope difference between var and let.
  • TypeScript Hello World tutorial.
    Typescript hello world example program code download.
  • Typescript Data Types tutorial.
    TypeScript data types system tutorial.
  • Typescript Variable Declaration tutorial.
    Typescript variable declaration example program tutorial.
  • TypeScript operators list tutorial.
    TypeScript operators list.
  • TypeScript Arithmetic Operators tutorial.
    TypeScript arithmetic operators example. TypeScript arithmetic operators precedence. List of TypeScript arithmetic operators.
  • TypeScript Comparison Operators tutorial.
    TypeScript comparison or relational operators tutorial. TypeScript comparison operators examples with output.
  • TypeScript Bitwise Operators tutorial.
    TypeScript bitwise operators tutorial. TypeScript bitwise operators example program with output.
  • Typescript Logical Operators tutorial.
    TypeScript logical operators tutorial. TypeScript logical operators example program with output.
  • TypeScript Assignment Operators tutorial.
    TypeScript assignment operators tutorial. TypeScript assignment operators example program with output.
  • Typescript Conditional Operator tutorial.
    Typescript conditional operator tutorial. Typescript ternary operator example program with output.
  • Typescript String Operator tutorial.
    Typescript string operator tutorial. Typescript string operator example program with output.
  • Typescript typeof Operator tutorial.
    Typescript typeof operator tutorial. Typescript typeof operator example program with output.
  • TypeScript control statements tutorial.
    TypeScript control statements example tutorial. TypeScript if else example programs with output.
  • TypeScript Switch Statement tutorial.
    TypeScript switch statement examples. TypeScript switch multiple case example. TypeScript switch case tutorial with program code.
  • TypeScript for loop tutorial.
    TypeScript for loop example. TypeScript for loop tutorial with example program code and output.
  • TypeScript for in loop tutorial.
    TypeScript for in loop example. TypeScript for in loop tutorial with example program code and output.
  • TypeScript while loop tutorial.
    TypeScript while loop example. TypeScript while loop tutorial with example program code and output.
  • TypeScript do while loop tutorial.
    TypeScript do while loop example. TypeScript do while loop tutorial with example program code and output.
  • Typescript for loop break tutorial.
    TypeScript for loop break example. TypeScript for loop break tutorial with example program code with output.
  • TypeScript for loop continue tutorial.
    TypeScript for loop continue example. TypeScript for loop continue tutorial with example program code with output.
  • Typescript function tutorial.
    Typescript function tutorial with example program and source code. Let us discuss Typescript function declaration and invocation with example.
  • Typescript returning function tutorial.
    Typescript returning function tutorial with example program and source code.
  • Typescript parameterized function tutorial.
    Typescript parameterized function tutorial with example program and source code.
  • Typescript function optional parameter tutorial.
    Typescript function optional parameter tutorial with example program and source code.
  • Typescript rest parameters tutorial.
    Typescript rest parameters tutorial with example program and source code. Typescript multiple optional parameters example.
  • Typescript default parameters tutorial.
    Typescript default function parameters tutorial with example program and source code.
  • Typescript anonymous function tutorial.
    Typescript anonymous function tutorial with example program and source code.
  • Typescript function constructor tutorial.
    Typescript function constructor tutorial with example program and source code.
  • Typescript Arrow/Lambda function tutorial.
    Typescript arrow lambda function tutorial with example program and source code.
  • Typescript function overloading tutorial.
    Typescript function overloading tutorial with example program and source code.
  • TypeScript number object tutorial.
    TypeScript number object tutorial with example program code.
  • TypeScript string object tutorial.
    TypeScript string object tutorial with example program code.
  • TypeScript boolean object tutorial.
    TypeScript boolean object tutorial with example program code.
  • TypeScript date object tutorial.
    TypeScript date object tutorial with example program code.
  • TypeScript math object tutorial.
    TypeScript math object tutorial with example program code.
  • TypeScript array object tutorial.
    TypeScript array object tutorial with example program code.
  • TypeScript tuples tutorial.
    TypeScript tuple tutorial with example program code.
  • TypeScript union type tutorial.
    TypeScript union type tutorial with example program code.
  • TypeScript interface tutorial.
    Typescript interface tutorial with example program and source code.
  • TypeScript interface inheritance tutorial.
    Typescript interface inheritance tutorial with example program and source code.
  • TypeScript interface multiple inheritance tutorial.
    Typescript interface multiple inheritance tutorial with example program and source code.
  • TypeScript class tutorial.
    Typescript class tutorial with example program and source code.
  • Typescript class inheritance tutorial.
    Typescript class inheritance tutorial with example program and source code.
  • Typescript class interface tutorial.
    Typescript class interface tutorial with example program and source code.
  • TypeScript abstract class tutorial.
    TypeScript abstract class tutorial with example program and source code.
  • TypeScript object tutorial.
    Typescript object tutorial with example program and source code.
  • TypeScript duck typing tutorial.
    Typescript duck typing tutorial with example program and source code.
  • TypeScript NameSpace tutorial.
    TypeScript namespaces tutorial with example program and source code.
  • TypeScript Multi-file namespaces tutorial.
    Typescript namespace multiple files tutorial with example program and source code.
  • TypeScript module tutorial.
    TypeScript module tutorial with example program and source code.
  • TypeScript ambient module tutorial.
    TypeScript ambient module tutorial with example program and source code.

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.