Groovy web console

subscribe to the feed Subscribe
to this
site
test groovy (via #groovywebconsole)
tweet this snippet Tweet
this
script

test groovy

Published 3 months ago by Maosn
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.json.JsonSlurper

def config = new JsonSlurper().parseText('{ "hello": "foo" }');
if (config['hello']) {
    println('hello is defined');
}

if (!config['bar']) {
    println('bar is not defined');
}