😇Array find, Tìm phần tử đầu tiên thỏa mãn điều kiện (ok)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find

Tìm phần tử đầu tiên thỏa mãn điều kiện

const array1 = [5, 12, 8, 130, 44];

const found = array1.find(element => element > 10);

console.log(found);
// expected output: 12

Last updated

Navigation

Lionel

@Copyright 2023