Last active
November 5, 2020 17:50
-
-
Save hernanBeiza/54754b975230a483df65af88abe37cf6 to your computer and use it in GitHub Desktop.
TS - Filtar dos arreglos
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 todosLosUsuarios = [{ userid: "100", nombre: "NN", rowid: "0" },{ userid: "101", nombre: "HB", rowid: "1" },{ userid: "102", nombre: "Marcus", rowid: "2" }]; | |
const usuariosFiltro = [{ userid: "101", nombre: "HB", rowid: "1" }]; | |
console.log("todosLosUsuarios", todosLosUsuarios); | |
console.log("usuariosFiltro", usuariosFiltro); | |
const encontrados = todosLosUsuarios.filter(array => !usuariosFiltro.some(filter => filter.userid !== array.userid)); | |
console.log("encontrados", encontrados); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment