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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<p id='text-1'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum accusamus est eveniet ad, |
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
// Problema para dar a entender o dar la idea de como funciona el metodo filter teniendiendo en cuenta | |
// que ya sabes algo de su parte teorica. | |
var arr = [1,2, 2, 4,];// Array original | |
const arrayFilter=(arr)=>{ | |
let result = arr.filter( (element, index, array) =>{ | |
console.log(element);// Primer elemento del Array |
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
let valor = new String ('Hola soy una cadena');//String que vamos a utilizar. | |
let lowerCase;//Variable para guradar el nuevo string | |
let upperCase;//Variable para guradar el nuevo string. | |
lowerCase = valor.toLowerCase();// Este metodo convertira toda la cadena en minuscula. | |
console.log(lowerCase)// Comprobamos en consola. | |
UpperCase = valor.toUpperCase()// Este metodo convierte toda la cadena en mayuscula. | |
console.log(upperCase)// Comprobamos en consola. |
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
// METODO SPLIT() | |
// El método split() divide un objeto de tipo String en un array (vector) de cadenas mediante la separación de la cadena en subcadenas. | |
let textString = "Lorem ipsum dolor sit, sit amet consectetur adipisicing elit.";// Cadena de texto. | |
// Este covierte una cadena en un Array. | |
// Pues el como se convierte el array va a depender de nostros, ya que le pasamos como parametro... | |
//la manera en al cual estara seprado |
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
let textString = " Lorem ipsum dolor sit, sit amet consectetur adipisicing elit. ";// Cadena de texto. | |
//METODO INCLUDES() | |
//El método includes() determina si una cadena de texto puede ser encontrada dentro de otra cadena de texto, | |
//retornando true o false según corresponda. | |
let stringIncludes = textString.includes('sit'); | |
console.log(stringIncludes);//Comfirmamos en la consola |
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
//Diferencia entre los iteradores array.prototype.map() y array.prototype.foreach() | |
let arr = [1,2,3,4,5]; | |
// Array.prototype.foreach() | |
const result_1 = arr.forEach(e => e + 1); | |
// Pues el iterador forEach en este caso retornara undefined | |
//Regresara este valor ya que solo itera todo los valores de array para hacer operaciones que no neciten | |
// que guarde el valor iterado(Valore del array) asi que lo prodriamos ver como un for de eso basico que conocemos. |
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
// Array.prototype.forEach() | |
// El método forEach() ejecuta la función indicada una vez por cada elemento del array. | |
const arr = ['lunes', 'Martes', 'Miercoles', 'Jueves','Viernes', 'Sabado', 'Domingo']; | |
const newList = arr.forEach( (element, index) =>{ // elemet = a los elemnto de arr index pues la posicion. | |
console.log( `<li id="${index}"> ${element}</li>`); | |
}) |
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
const person = { | |
nombre: 'Jerly', | |
apellido: 'De La Rosa', | |
edad:18, | |
pasatiempos: ['Ejercitarme', 'Jugar','Leer'], | |
contactos: { | |
email: '[email protected]', | |
twitter: '@jerly05', | |
web: 'jerlydelarosa.com' | |
} |
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
// Clases modelos a seguir | |
//Intacia (Objetos) de las clases = | |
// Atributos(son variables dentro de un objeto(Propiedades)) | |
// Metodos(Fuciones dentro de un objecto(Acciones)) | |
class Animal { | |
constructor(nombre, raza){ | |
this.nombre = nombre;// Atributo de la clase Animal | |
this.raza = raza;// Atributo de la clase Animal | |
} | |
saludar (){//Metodo de la clase animal |
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
console.error('Esto es un error');// este metodo crea un mensaje de error | |
console.warn('Esto es ua alerta');// Este metodo crea un alerta | |
console.info('Esto es una imformacion');// Para envira imfomacion | |
console.log('Regrito');//Este meto es un resgitro de lo que esta sucediendo | |
// console.clear('Limpia a la consola'); | |
console.dir(document); //Muestra todas las propiedades | |
console.group('Litas de metodos');// Crea un grupo | |
console.log('Metodo Filter()'); | |
console.log('Metodo Map()'); |
OlderNewer