DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Tony Colston
Tony Colston

Posted on

the elvis operator

I was reading through Groovy 3.0 release notes

https://groovy-lang.org/releasenotes/groovy-3.0.html

Lots of stuff but what caught my eye was the elvis operator

// original elvis operator
?: 

// shortened elvis operator
?=
Enter fullscreen mode Exit fullscreen mode

Looks longer to me. :)

More on the elvis operator here at wikipedia if you have not encounter such a thing before: https://en.wikipedia.org/wiki/Elvis_operator

Top comments (0)

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.