Skip to content

Instantly share code, notes, and snippets.

Last active Dec 12, 2015
What would you like to do?
hashspace Foreach loop and json interaction
// The model is accessible with the name `vscope`
// `json` has also methods to handle arrays
// - push
// - splice
// - shift
json.push(vscope.things, "Mangos");
# template main(things)
Remember to buy:
# foreach oneThing in things
# if oneThing_isfirst
First of all
# else
# if oneThing_islast
and last
# else
# /if
# /if
# /foreach
# /template
display(main, [["Apples", "Pears", "Bananas"]]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment