Skip to content

Instantly share code, notes, and snippets.

@darkfrog26
Created June 12, 2012 19:06
Show Gist options
  • Save darkfrog26/2919468 to your computer and use it in GitHub Desktop.
Save darkfrog26/2919468 to your computer and use it in GitHub Desktop.
JavaScript DSL
var x = 5;
var y = 6;
var entries = [1, 2, 3, 4];
var message = 'Testing';
entries[4] = 5;
if (x == y) {
alert('Hello World!');
}
else if (x <= y) {
alert(message);
}
for (x in entries) {
alert('Current: ' + x + ' entry');
}
val x = Variable(5, "x")
val y = Variable(6, "y")
val entries = Array(List(1, 2, 3, 4), "entries")
entries(4) = 5
val message = Variable("Testing", "message")
If (x Equals y) {
alert("Hello World!")
}
ElseIf (x <= y) {
alert(message)
}
For (x in entries) {
alert(Variable.formatted("Current: %s entry", x))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment