Skip to content

Instantly share code, notes, and snippets.

~/bin/src/coffee-script $ coffee -pe "thing[stuff()] ?= 5"
(function() {
var _a, _b;
thing[(_a = stuff())] = (typeof (_b = thing[(_a = stuff())]) !== "undefined" && _b !== null) ? thing[_a] : 5;
})();
should be
~/bin/src/coffee-script $ coffee -pe "thing[stuff()] ?= 5"
(function() {
~ $ cat > test.coffee
a: 3
b: 4
c: a + b
~ $ coffee -p test.coffee
(function() {
{
a: 3,
~ $ coffee -pe "a: 3"
(function() {
{
a: 3
};
})();
~/bin/src/node $ coffee -pe "i in [0..10]"
(function() {
var _a, _b, _c, _d, _e;
!!(function(){ for (var _d=0, _e=(_a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).length; _d<_e; _d++) if (_a[_d] === i) return true; }).call(this);
})();
~/bin/src/node $ coffee -pe "x: [0..10]"
(function() {
var _a, _b;
{
x: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
};
})();