Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
cascade syntax for JS
// inspired by
// traditional method chaining with combinators:
console.log(range(1, 3)
.concat(range(4, 6))
.map(function(x) { return x * x })
.filter(function(x) { return x % 2 === 0 })
// method chaining with cascades:
->moveTo(10, 10)
->ellipse(50, 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment