-
Notifications
You must be signed in to change notification settings - Fork 1
Array prototype find
garevna edited this page Apr 6, 2019
·
1 revision
Метод ищет в массиве и возвращает первый найденный элемент, удовлетворяющий заданному условию
Если такого элемента в массиве нет, возвращает undefined
var cards = [
{ num: "457892425", cash: 1100 },
{ num: "457812840", cash: 3000 },
{ num: "457855780", cash: 1200 },
{ num: "457811714", cash: 5000 }
]
cards.find (
function ( card ) {
return card.cash > 4000
}
)▼ { num: "457811714", cash: 5000 }
cash: 5000
num: "457811714"
► __proto__: ObjectfindIndex()
flatMap()
forEach()
keys()
map()
reduce()
reduceRight()
some()
sort()
values()