Created
July 15, 2020 03:36
-
-
Save matheusmurta/44a3d30046ff8b2e3c67fc89c4ddaa80 to your computer and use it in GitHub Desktop.
Filtrar itens de um array baseado no conteudo da key
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
Filtrar itens de um array baseado no conteudo da key | |
var PATTERN = 'bedroom', | |
filtered = myArray.filter(function (str) { return str.includes(PATTERN); }); | |
ou | |
var PATTERN = 'La'; | |
const filtered = users.results.filter((obj) => | |
obj.name.first.includes(PATTERN) || obj.name.last.includes(PATTERN) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment