Mẹo Hay

Array 'find' method in JavaScript (Array.prototype.find) – JavaScript Tutorial For Beginners

Rate this post



The find() method in Javascript is used on arrays to find the first element in the array that meets a condition which you pass in through a function. In this video, we …

Tag: find in array javascript, [vid_tags]

Xem thêm: https://blogthủthuật.vn/category/pc

Nguồn: https://blogthủthuật.vn

12 Comments

  1. I just spent maybe 3 hours trying to do this as prescribed by my teacher, and still couldn't figure it out – teacher insists on callback functions with functions to find a match in an array, made no sense to me whatsoever, maybe 12 lines of code for the same result as this. Finally got it working in 30 seconds with this. Thanks.

    Reply
  2. const personas = [

    {nombre: 'Dom', ocupacion: 'Desarrollador'},

    {nombre: 'Eric', ocupacion: 'Dentista'},

    {nombre: 'Kate', ocupacion: 'Peluquera'}

    ];

    const people = [

    {name: 'Dom', ocupation: 'Software developer'},

    {name: 'Eric', ocupation: 'Dentist'},

    {name: 'Kate', ocupation: 'Hair dresser'}

    ];

    Reply

Post Comment