Creando un contador sencillo con typescript [ESP- ENG]

avatar

Estoy dedicando tiempo en aprender “typescript” porque considero que con lo que se de JAVA puedo aprender con más fundamentes este lenguaje de programación y el porqué de uso, no simplemente escribir código por escribir.
Tiene una sintaxis similar a JAVA, pero hay algunas cuantas cosas que cambian, lo mas similar que encontré es que al decir que tipo de dato llevara el código se presentan ambos tipos el constructor y el dato; el constructor me permite utilizar todos los métodos existentes para ese dato y en cambio el otro solo indica el tipo de dato con algunos métodos accesibles, algo típico de JAVA.

I am dedicating time to learning “typescript” because I consider that with what I know about JAVA I can learn this programming language more fundamentally and the reason for its use, not simply write code for the sake of writing. It has a syntax similar to JAVA, but there are a few things that change, the most similar thing I found is that when saying what type of data the code will carry, both types of the constructor and the data are presented; The constructor allows me to use all the existing methods for that data and, on the other hand, the other only indicates the type of data with some accessible methods, something typical of JAVA.
Podría aplicar cambios más significativos en “typescript” en mi código para ser más ordenado como bien dirían algunos, pero no soy tan obsesionado con el código, para implementar interfaces para algo que no es necesario si ya es funcional. Lo que me dejo sorprendido es que se debe especificar qué tipo de etiqueta semántica es, si es un botón debo especificarlo con el capturado, sino dejar el valor “null” que indica que no se encontró esa etiqueta. El resto fue transpilar el código y verificar que me retornaba dentro de mi archivo de JavaScript.
I could apply more significant changes to “typescript” in my code to be more organized as some would say, but I am not so obsessed with the code, to implement interfaces for something that is not necessary if it is already functional. What surprised me is that you must specify what type of semantic label it is, if it is a button I must specify it with the captured one, otherwise leave the value “null” which indicates that that label was not found. The rest was transpiling the code and verifying that it returned inside my JavaScript file.


0
0
0.000
3 comments
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000
avatar

Eso está muy bien. Desde que conocí TypeScript no me gusta trabajar con sólo JavaScript y me pregunto cómo pude hacer mi tesis de grado sin él.

0
0
0.000
avatar

Esta bueno, por el momento se lo básico en un futuro me voy a perfeccionar mas

0
0
0.000