-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add typescript solution challenge-00
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
2024/00-sintaxis-variables-tipos-de-datos-y-hola-mundo/solution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// ¡Preparad@ para aprender o repasar el lenguaje de programación que tú quieras? | ||
// - Recuerda que todas las instrucciones de participación están en el | ||
// repositorio de GitHub. | ||
// | ||
// Lo primero... ¿Ya has elegido un lenguaje? | ||
// - No todos son iguales, pero sus fundamentos suelen ser comunes. | ||
// - Este primer reto te servirá para familiarizarte con la forma de participar | ||
// enviando tus propias soluciones. | ||
// | ||
// EJERCICIO: | ||
// - Sitio web oficial de JavaScript: https://developer.mozilla.org/es/docs/Web/JavaScript | ||
|
||
// - Representa las diferentes sintaxis que existen de crear comentarios | ||
// en el lenguaje (en una línea, varias...). | ||
|
||
/* | ||
Comentario de múltiples líneas | ||
*/ | ||
|
||
// - Crea una variable (y una constante si el lenguaje lo soporta). | ||
let miVariable2: string = 'Hola, mundo'; | ||
// eslint-disable-next-line no-unused-vars | ||
const miConstante2: number = 42; | ||
|
||
// - Crea variables representando todos los tipos de datos primitivos | ||
// del lenguaje (cadenas de texto, enteros, booleanos...). | ||
let cadenaTexto2: string = 'Hola'; | ||
let numeroEntero2: number = 42; | ||
let numeroDecimal2: number = 3.14; | ||
let booleano2: boolean = true; | ||
let bigInt2: bigint = 9007199254740991n; | ||
let nulo2: null = null; | ||
let indefinido2: undefined = undefined; | ||
let simbolo2: symbol = Symbol('Hola'); | ||
let objeto2: { nombre: string; edad: number } = { | ||
nombre: 'Pepe', | ||
edad: 42, | ||
}; | ||
let array2: number[] = [1, 2, 3]; | ||
|
||
// - Imprime por terminal el texto: "¡Hola, JavaScript!" | ||
console.log('¡Hola, JavaScript!'); |