Reto 2 #8

Open
opened 2022-02-24 09:29:42 +01:00 by jameos · 1 comment
jameos commented 2022-02-24 09:29:42 +01:00 (Migrated from github.com)

const miLista = [1, 9, 87, 3, 10, 4, 20, 2, 45]; // obtener números de 1 digito [1, 9, 3, 4, 2];

const solucion1 = miLista.filter( item=> item.toString().length==1 )
const solucion2 = miLista.filter (item=> (''+item).length==1 )

console.log(solucion1)
console.log(solucion2)

const miLista = [1, 9, 87, 3, 10, 4, 20, 2, 45]; // obtener números de 1 digito [1, 9, 3, 4, 2]; const solucion1 = miLista.filter( item=> item.toString().length==1 ) const solucion2 = miLista.filter (item=> (''+item).length==1 ) console.log(solucion1) console.log(solucion2)
tanrax commented 2022-02-25 13:01:22 +01:00 (Migrated from github.com)

Buen trabajo!

Buen trabajo!
Sign in to join this conversation.