why is typescript better than javascript code example

Example 1: typescript vs javascript

JavaScript:
function my_function(my_param) {
  console.log('do something');
}
TypeScript:
function my_function(my_param: any) {
  console.log('do something');
}

Example 2: typescript vs javascript

They are really almost the same theres not the same param types like
JAVASCRIPT is function myFunction(param)
while typescript is
function myFunction(the_param: something)

Example 3: is typescript faster than javascript

Slightly faster. TypeScript is compiled to javascript but to a minimised form
and therefore loads faster.

Tags:

Misc Example