Skip to content

Instantly share code, notes, and snippets.

@luisfelipe-dev
Created November 13, 2019 00:55
Show Gist options
  • Select an option

  • Save luisfelipe-dev/fdd6933c4d4e7d81990943ee2a9d916e to your computer and use it in GitHub Desktop.

Select an option

Save luisfelipe-dev/fdd6933c4d4e7d81990943ee2a9d916e to your computer and use it in GitHub Desktop.
const usuarios = [
{ nome: "Carlos", tecnologias: ["HTML", "CSS"] },
{ nome: "Jasmine", tecnologias: ["JavaScript", "CSS"] },
{ nome: "Tuane", tecnologias: ["HTML", "Node.js"] }
];
function listaUsuarios(users) {
for (let i = 0; i < users.length; i++) {
console.log(`${users[i].nome} trabalha com ${users[i].tecnologias}`);
}
}
function checaSeUsuarioUsaCSS(usuarios) {
for (let i = 0; i < usuarios.length; i++) {
for (let j = 0; j < usuarios[i].tecnologias.length; j++) {
if (usuarios[i].tecnologias[j] === "CSS") {
console.log(`O usuário ${usuarios[i].nome} trabalha com CSS`);
}
}
}
}
listaUsuarios(usuarios);
checaSeUsuarioUsaCSS(usuarios);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment