FrontEnd.ro logo
Funcții pe Array-uri / partea 2
let contacts = [
  { name: "Alex", email: "alex@test.com" },
  { name: "Jon", email: "jon@test.com" },
  { name: "Diana", email: "diana@test.com" }
];

let indexOfJon = contacts.findIndex((contact) => {
  return contact.name === "Jon";
});
console.log(indexOfJon); // 1