Last active
December 14, 2022 21:25
-
-
Save matefs/e9bfce267e263bcbbd555b8703a3545b to your computer and use it in GitHub Desktop.
Como fazer um filtro de pesquisa por string
This file contains 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
const livros = [ | |
{nome: 'Liderança em Design ', id : 1, src: ''}, | |
{nome: 'Javascript assertivo ', id : 2, src: ''}, | |
{nome: 'Cangeceiro em Javascript ', id : 3, src: ''}, | |
{nome: 'Aventureiros do Java ', id : 4, src: ''}, | |
] | |
var textoDigitado = 'Lid' | |
const resultadoPesquisa = livros.filter( livro => livro.nome.includes(textoDigitado) ) | |
console.log(resultadoPesquisa) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment