Skip to content

CoffeeScript Cheat Sheet

Lance Pollard edited this page Sep 25, 2012 · 1 revision

CoffeeScript Cheat Sheet

=> vs ->

key in object

return true if key of object
return true if object.hasOwnProperty(key)

{key1, key2}

{@key1}

@render "action", locals: {post: @post}
@render "action", locals: {@post}

OR=

a ?= true

b ||= true

c or= true
if (typeof a === "undefined" || a === null) a = true;

b || (b = true);

c || (c = true);
Clone this wiki locally