diff --git a/JS/reto1.js b/JS/reto1.js index 5637c0e..f379ccc 100644 --- a/JS/reto1.js +++ b/JS/reto1.js @@ -1,3 +1,19 @@ -let arr = ['julio', 'pedro', 'vero', 'juan']; +//let arr = ['julio', 'pedro', 'vero', 'juan']; +//let res =[]; +//arr.forEach( (item)=>{ +// res.push(item.length); +//}); +//console.log(res); +//console.log(arr); -console.log(arr); \ No newline at end of file + +let arr = ['julio', 'pedro', 'vero', 'juan']; +const lengthArr = arr.map(item=>{ + if (item.length>4) + return item.length + +}).filter(item=>{ + return item!=undefined; +}); + +console.log(lengthArr); \ No newline at end of file