Monthly Archives: November 2014

Safely get the first element from Groovy list

In Groovy it is safe to get the first collection element using standard bracket syntax even for empty collections. So you can use: list[0] For example: assert [][0] == null

Posted in Groovy | Tagged , | Leave a comment

Javascript !! construct

In JavaScript I often see the construct !!object The construct converts an object into boolean. I remember it as “bang, bang, you are boolean“

Posted in IT, JavaScript | Tagged | Leave a comment