Creando un contador sencillo con typescript [ESP- ENG]

in voilk •  4 months ago

    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.
      Authors get paid when people like you upvote their post.
      If you enjoyed what you read here, create your account today and start earning FREE VOILK!