QUEST #266 · FILTRAGEMcode

Filter dos Fortes

Filtre o array de heróis para manter só os de nível > 10.

LV.3+95 XP
📖 CONCEITO

array.filter(cb) retorna novo array com elementos que passam no teste. Não muta original.

EXEMPLO DE USO

herois.filter(h => h.nivel > 10)

🗄️ SCHEMA
Array `herois = [{nome:'Arion',nivel:12},{nome:'Lyra',nivel:8}]`
🎯 DESAFIO

Filtre `herois` onde `h.nivel > 10` usando filter.

> CONSOLE_MÁGICO.JS