Groovy web console

subscribe to the feed Subscribe
to this

variadic function call

Published 8 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def someFunc(arg1, arg2){
    println arg1 + arg2

def funcCaller(Object... params){

    (params).each { it() }

funcCaller({ s1="Hello", s2='World' -> someFunc(s1, s2) }, { s1="Other ", s2='Func' -> someFunc(s1, s2) })