Guruji Point - Code You Want To Write

  • Home
  • Asp.Net
  • WCF
  • SQL
  • Type Script
  • AngularJS
  • Tech News
  • Blog
  • Earn Online

Sunday, 28 May 2017

Type Script Over Java Script With Example

 typescript     No comments   


Introduction
In this article we will learn why TypeScript? Why Typescript become more famous and how can the TypeScript different from JabvaScript. What is the basic difference in syntax's of both languages. Should we follow TypeScript or JavaScript.

Previous Updates

In previous articles we have learnt what is TypeScript and How to Install this on VS2015 .AngularJS basics, Difference IEnumerabe vs IQueryable. What is Cursor in sql and use of cursor.  Best basic C# interview questions.

Why JavaScript Complicated For OOP Based Developers
JavaScript is most famous language in 2017. All browsers compatible and easy to learn. But if you are new in javascript then it is ok but if you came across the object oriented field then it will create some complexity to you

If you have to create a class in JavaScript then you create a Function sounds unusual to Object Oriented background developer ,also  if you need to create properties then you can define this with this keyword and if you want to create a function then you can achieve this differently in JavaScript.  Below Example

<script >
    function Employee()                            // Employee Class
    { 
        this.EmpId = "";                                // Property
        this.EmpName = "";
        this.ValidateEmp = function ()          //Function with in Class
                {
                    alert('Validate Successfully.')
                }
    }
</script>

So if you are Coming from Object Oriented background and when you first look the above code you will be confused what is that ? for reduce this JavaScript complexity Micorosoft invented the TypeScript for Object oriented developers to feel them cool while writing code.

TypeScript says that it will very difficult to grasp the all concept of JavaScript so that i will provide you ability to write your class properties methods as you written in C# or Java(Object Oriented Programming) and it will compiled your TypeScriptCode into a plane JavaScriptFile. Below Example


class Employee
{
    public EmpName: string = "";
 }


When we save this type script file it will autometic generate a js file with same name and create a Javascript cocde for above given TypeScript Code.


Here you can easily saw how easy type script is which creates javascript code file for you automatically.
In this next Update we will learn how to done programming with TypeScript from Scratch. Keep reading keep sharing. Happy Programming.


  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Facebook Updates

Guruji Point

Categories

Comman table Expression in SQL Dynamic Grid Row IQueryable in c# Learn AngularJS Scope_Identity() Use of indexes comma seperated string in sql row_number() and dense_rank() salary table structure. while loop in sql why do we need cursor why tuple used

About Us

This blog is about the Programming ,Tech News and some intresting facts related Contents. Here you can find fundamental and expert level topic of programming languages very practically related to C# , Asp.Net ,Sql-Server, JavaScript, Jquery, WebServices And also Web-Api, WCF ,WPF, Angular Js.

Contact Us

Email Us - gurujipoints@gmail.com
Contact- 8077657477

Reach Us

Copyright © Guruji Point - Code You Want To Write