About the CoffeeScript compiler
CoffeeScript that gets turned into JavaScript in your browser. Run CoffeeScript code in your browser with no install and no signup — the editor, the input and the output share one screen. CoffeeScript compiles and runs on your own device through WebAssembly, so once the page has loaded it keeps working without a network connection.
Press Run to execute the program, edit it and press Run again, or paste your own code over it. Everything you type stays in the page; the editor caches your work locally so a reload does not lose it.
A CoffeeScript example
This is the program the CoffeeScript editor opens with — run it as it is, then change it.
# CoffeeScript features
square = (x) -> x * x
cube = (x) -> square(x) * x
console.log "Squares:", (square x for x in [1..10])
console.log "Cubes:", (cube x for x in [1..5])
# Destructuring
{name, age} = name: "Alice", age: 28
console.log "\n\#{name} is \#{age} years old"
# Classes
class Animal
constructor: (@name, @sound) ->
speak: -> "\#{@name} says \#{@sound}"
dog = new Animal "Dog", "Woof!"
cat = new Animal "Cat", "Meow!"
console.log dog.speak()
console.log cat.speak()
# Array comprehension with filter
evens = (x for x in [1..20] when x % 2 is 0)
console.log "\nEvens:", evens
More Web & Scripting compilers
Browse all 109 languages — the same editor runs each of them, in the browser or on a shared runner.