Categories
Medium Problems

โจทย์ข้อที่ MX0005

จงเขียนฟังก์ชั่นที่ส่งค่า true ออกมา หาก array ที่ใส่เข้าไปมีสมาชิกที่มีค่าเท่ากับหรือมากกว่าตัวเลขที่ใส่เป็นตัวที่สอง นอกนั้นให้ส่ง false ออกมา

Examples

existsHigher([5, 3, 15, 22, 4], 10) ➞ true

existsHigher([1, 2, 3, 4, 5], 8) ➞ false

existsHigher([4, 3, 3, 3, 2, 2, 2], 4) ➞ true

existsHigher([], 5) ➞ false

Leave a Reply