Can we use TypeScript in place of JavaScript?

I have a confession to make, I am one of those guys who tried to learn JavaScript many times but failed miserably despite having coding skills in many other languages. Recently I heard about TypeScript and really liked its way of programming. Can I ask if we can replace JS and in its place use TS.

Lets say I have to built a simple calculator with HTML+JS+CSS only. Could I use TS to write the code, then compile it to JS and use this for my above calculator project? Will TS code be able to interact with the DOM elements like native JS?


1 Reply

JA Jesus Arockia Sankaran S Syncfusion Team October 7, 2020 01:11 AM UTC

Hi Chetan, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your query and we can develop any application using TypeScript as we do using JavaScript since TypeScript is superset of JavaScript with type checking. After compiling the TS code, it is converted to JS code so there is no difference in DOM elements. Also, we request you post this general question in public forum such as stackoverflow, MS developer forums, etc.. to get details from much broader developer community. 
 
We request you to check the details for TypeScript from the below documentation. 
 
 
Please get back to us if have any queries regarding Syncfusion components. 
 
Regards, 
Jesus Arockia Sankaran S 


Loader.
Up arrow icon