diff --git a/Basic/00-helloworld.js b/Basic/00-helloworld.js index 23a48e6e..42088d4e 100644 --- a/Basic/00-helloworld.js +++ b/Basic/00-helloworld.js @@ -10,7 +10,7 @@ Vídeo: https://youtu.be/1glVfFxj8a4?t=2390 /* Esto es -un comentario +un comentario k en varias líneas */ diff --git a/Basic/00-holamundo.js b/Basic/00-holamundo.js new file mode 100644 index 00000000..0277cacf --- /dev/null +++ b/Basic/00-holamundo.js @@ -0,0 +1,20 @@ +//Esto es un comentario simple + + +/*esto +es +un +comentario +en varias líneas*/ + + +console.log("¡Hola, JavaScript"); +console.log('Hola JavaScript') + +console.log(5) +console.log("5") +console.log(5 + 2) +console.log(5 - 2) +console.log(5 / 2) +console.log(5 % 2) +console.log(5 ** 2) \ No newline at end of file diff --git a/Basic/01-variablesmaria.js b/Basic/01-variablesmaria.js new file mode 100644 index 00000000..23a59c97 --- /dev/null +++ b/Basic/01-variablesmaria.js @@ -0,0 +1,24 @@ +//var + +var helloWorld = " Hola,JavaScript " +console.log(helloWorld) + +helloWorld = " Hola de nuevo, Javascript " +console.log(helloWorld) + +//let +let helloWorld2 = " Hola,JavaScript 2 " +console.log(helloWorld2) + +helloWorld2 = " Hola de nuevo, Javascript 2 " +console.log(helloWorld2) + +//const +const helloworld3 = " Hola JavaScript 3 " +console.log(helloworld3) + + +//Error +//helloworld3 = " Hola de nuevo, JavaScript 2 " +//console.log(helloworld3) + diff --git a/Basic/02-datatypes.js b/Basic/02-datatypes.js index ab37f6ee..94459c4c 100644 --- a/Basic/02-datatypes.js +++ b/Basic/02-datatypes.js @@ -6,7 +6,7 @@ Vídeo: https://youtu.be/1glVfFxj8a4?t=3599 // Tipos de datos primitivos // Cadenas de texto (string) -let myName = "Brais Moure" +let myName = "Brais paco2" let alias = 'MoureDev' let email = `braismoure@mouredev.com` diff --git a/Basic/02-tipodedatos.js b/Basic/02-tipodedatos.js new file mode 100644 index 00000000..38baa6f3 --- /dev/null +++ b/Basic/02-tipodedatos.js @@ -0,0 +1,38 @@ +// String (cadena de texto) +let name = "María García" +let alias = "Rizos" +let email = "magaru91@icloud.com" + +//Números +let age = 34 //entero +let height = 1.76 // Decimal + +// Booleanos +let isStudent = true +let isTeacher = false + +//undefined +let undefiunedValue +console.log(undefiunedValue) + +//null +let nullValue = null + +//Symbol +let mySymbol = Symbol ("mysymbol") + +//BigInt +let myBigInt = (549687657877967674578768768454687) +let myBigInt2 = 8678967857567678768574574638796754687987857878967n + +//Mostramos los tipos de datos +console.log(typeof name) +console.log(typeof alias) +console.log(typeof email) + +console.log(typeof age) +console.log(typeof isTeacher) + +console.log(typeof undefiunedValue) +console.log(typeof null) + diff --git a/Basic/03-beginner-exercises.js b/Basic/03-beginner-exercises.js index 2e7dd657..a1ad32df 100644 --- a/Basic/03-beginner-exercises.js +++ b/Basic/03-beginner-exercises.js @@ -1,24 +1,124 @@ /* -Clase 18 - Ejercicios: primeros pasos + 18 - Ejercicios: primeros pasos Vídeo: https://youtu.be/1glVfFxj8a4?t=4733 */ -// 1. Escribe un comentario en una línea +// 1. Escribe un comentario en sola línea +//Hola Javascript// // 2. Escribe un comentario en varias líneas +/*hola +javascript*/ // 3. Declara variables con valores asociados a todos los datos de tipo primitivos +//String +let myName = "María" + +//Number +let age = 34 +let height = 1.76 +//boolean +let isTeacher = false +let isStudent = true +//Undefined +let undefinedValue = undefined +//null +let nullValue = null +//Symbol +let mySymbol = Symbol("mySymbol") +//BigInt +let myBigInt = BigInt(65789779656587974654687789679674658748967897967) +let myBigInt2 = 576878654963796796578967968746789679687879687634n + // 4. Imprime por consola el valor de todas las variables +console.log (myName) +console.log (age) +console.log (height) +console.log (isTeacher) +console.log (isStudent) +console.log (undefinedValue) +console.log (nullValue) +console.log (mySymbol) +console.log (myBigInt) +console.log (myBigInt2) // 5. Imprime por consola el tipo de todas las variables +console.log (typeof myName) +console.log (typeof age) +console.log (typeof height) +console.log (typeof isTeacher) +console.log (typeof isStudent) +console.log (typeof undefinedValue) +console.log (typeof nullValue) +console.log (typeof mySymbol) +console.log (typeof myBigInt) +console.log (typeof myBigInt2) // 6. A continuación, modifica los valores de las variables por otros del mismo tipo +myName = "Ana" +age = 25 +height = 1.65 +isTeacher = true +isStudent = false +undefinedValue = undefined +nullValue = null +mySymbol = Symbol("newSymbol") +myBigInt = BigInt(12345678901234567890) +myBigInt2 = 999999999999999999999999999n + // 7. A continuación, modifica los valores de las variables por otros de distinto tipo +myName = 123 +age = "veinte y 6" +height = true +isTeacher = null +isStudent = undefined +undefinedValue = false +nullValue = true +mySymbol = 1.25 +myBigInt = "12345678901234567890" +myBigInt2 = null // 8. Declara constantes con valores asociados a todos los tipos de datos primitivos +//String +const myName2 = "Ale" +//Number +const age2 = 30 +const height2 = 1.70 +//boolean +const isTeacher2 = true +const isStudent2 = false +//Undefined +const undefinedValue2 = undefined +//null +const nullValue2 = null +//Symbol +const mySymbol2 = Symbol("Alex") +//BigInt +const myBigInt1 = BigInt(65789779656587974654687789679674658748967897967) +const myBigInt3 = 576878654963796796578967968746789679687879687634n // 9. A continuación, modifica los valores de las constantes +//String +//estas líneas darían error por que no se puede redeclarar una constante +//myName = "Pepa" +//Number +//age = 49 +//height = 1.50 +//boolean +//isTeacher = true +//isStudent = false +//Undefined +//undefinedValue = undefined +//null +//nullValue = null +//Symbol +//mySymbol = Symbol("nuevoSymbol") +//BigInt +//myBigInt = BigInt(1234567891000012454897968545657897) +//myBigInt2 = 787897897897897897897897897897897897447141n -// 10. Comenta las líneas que produzcan algún tipo de error al ejecutarse \ No newline at end of file +// 10. Comenta las líneas que produzcan algún tipo de error al ejecutarse +//no puedo redeclarar una variable con el mismo nombre en el mismo archivo +//no puedo redeclarar let o const con el mismo nombre en el mismo ámbito \ No newline at end of file diff --git a/Basic/tempCodeRunnerFile.js b/Basic/tempCodeRunnerFile.js new file mode 100644 index 00000000..285aeb75 --- /dev/null +++ b/Basic/tempCodeRunnerFile.js @@ -0,0 +1,2 @@ + +console.log(helloworld3) \ No newline at end of file