Apache Groovy is the language that should have been called JavaScript because it is a scripting version of Java.
def a = 1 //local variable
b = 2 //global variable
a //error
b //this works
//closure example
timesTwo = {x -> x*2}
timesTwo(4)
timesTwo("Multiplying Strings!")
sin(3.1415)