function repetir(cadena, numero) { if (cadena.length != 1) { return ""; } return cadena.repeat(numero); } console.log(repetir("a", 6)) console.log(repetir("aasdasd", 6)) function masLarga(cad1, cad2) { return cad1.length > cad2.length ? cad1 : cad2 } console.log(masLarga("hola", "adios")) console.log(masLarga("hola amigos", "adios")) function eliminarPares(lista) { return lista.filter(cad => cad.length % 2 != 0) } console.log(eliminarPares(["aa", "bbb", "ccccc", "dddd"])) function repetidas(cadena){ for(i=1;i<cadena.length;i++){ if (cadena.at(i)==cadena.at(i-1) && cadena.at(i)!=" "){ return true; } } return false; } function repetidasForeach(cadena){ let res=false cadena.split('').forEach((valor,i)=>{ if (valor==cadena.at(i+1)){ res= true; return } }) return res; } console.log(repetidasForeach('La luvia en madrid'))