This will safely return null without throwing any exceptions
obj?.prop1?.prop2
How can I do that for collections, where it won't throw an index out of bounds exception?
myarray[400] //how do I make it return null if myarray.size() < 400
Is there such an operator for Collections?
def a = [] ; println a[ -1 ]
throws ajava.lang.ArrayIndexOutOfBoundsException
– Rutherford