Query: how can I get the minimum value from the map in Grails
So far I have found the following code to get the minimum value from the map in groovy
["Java":1, "Groovy":4, "JavaScript":2].min{it.value}
but it does not work in grails
I tried the following code snippet
def map = ["Java":1, "Groovy":4, "JavaScript":2]
println map.min{it.value}
assert map.min{it.value}==1
Thanks in advance
source
share