How to check if any value in a one-dimensional array a is larger than x using some in TypeScript

1 Answer

0 votes
const arr: number[] = [1, 3, 5, 6, 9, 10, 11];
const x = 7;

const isAnyLarger: boolean = arr.some(value => value > x);

console.log(isAnyLarger);



/*
run:

true

*/


 



answered Jun 26 by avibootz
...