AWS

Groovy : Find Index of Element in Map

Groovier way of finding index of element from Map. It can be obtained with findIndexOf Method, which accepts closure as argument. [groovy] Map map=["groovy":1,"grails":2,"index":3,"element":4] assert 3 == map.findIndexOf{it.key=="element"} assert 0...

by Hitesh Bhatia
Tag: map
10-Nov-2011

Javascript/Ajax/JQuery

Jquery : map and grep functions

Hi friends, I was going through some utility funcitons being provided by jQuery. Found few methods like grep, map very userful that saves me from writing loops. I could relate them with grep, collect respectively as provided by Groovy, thought would share with you. I will be taking examples with JSON objects say Student. grep() ...

by Amit Jain
Tag: map
15-Nov-2010