Groovy web console

subscribe to the feed Subscribe
to this
site

Check if any value in a list is larger than a limit

Published 2 years ago by vmj
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
final a = [1, 2, 3, 4, 5, 6]
final x = 3
final f = { println "Yes" }

if (a.any { it > x })
    f()