This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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, |
NewerOlder