CoffeeScript

Michael Recachinas

History

Title Text

Brandon Eich makes JS

 

JavaScript

CoffeeScript

foo = (x) -> 2*x

// variables
var num = 2014;

// functions
function foo (x) {
    return 2*x;
}

// objects
var obj = {
    name: "Obj",
    title: "blah",
    toString: function () {
        console.log("The name is " + this.name);
    }
};

// variables
num = 2014

// functions
foo = (x) -> 2 * x;

// objects
obj =
    name: "Obj"
    title: "blah"
    toString: () -> console.log 'The name is #{this.name}'

CoffeeScript

By Michael Recachinas

CoffeeScript

  • 206