I’ll give some context on what we are trying to achieve and the steps we have taken so far.
Related issues we have filled on this issue:
I’ll give some context on what we are trying to achieve and the steps we have taken so far.
Related issues we have filled on this issue:
var positioned = ['x', 'y']; | |
// an parameter object is full if the domain does not contain any falsies | |
function isFull(object) { | |
return _(object) | |
.omit(_.identity) | |
.keys() | |
.value() | |
.length; | |
} |
// don't have to declare frame, purer | |
function animate(fn) { | |
function anim(frame) { | |
fn(frame); | |
requestAnimationFrame(_.partial(anim, frame + 1)); | |
} | |
requestAnimationFrame(_.partial(anim, 0)); | |
} | |
var circle = (function() { | |
// all shapes should show by default at the center of the canvas | |
var x = 10, | |
y = 10, | |
radius = 10; | |
return { | |
at: function(x, y) { | |
this.x = x; | |
this.y = y; |
// haskell | |
// sort [] = [] | |
// sort (x:xs) = sort lte ++ [x] ++ sort gt | |
// where lte = [a | a <- xs, a <= x] | |
// gt = [a | a <- xs, a > x] | |
var data = [4,5,8,9,1,2,3,9,1,5,1,9,5,3,3,3,8,9]; | |
function sort(data) { | |
if (data.length === 0) return []; |
function mandelbrotRank (timeout, x, y) { | |
var i = 0, | |
zx = x, | |
zy = y; | |
while (zx*zx + zy*zy < 4 && i < timeout){ | |
var tx = zx*zx - zy*zy + x, | |
ty = 2*zx*zy + y; | |
zx = tx; |
function any() { | |
return _.reduce(arguments, function(sum, n){ return sum || n; }, false); | |
} | |
function any() { | |
return _.some(arguments); | |
} | |
function all() { | |
return _.reduce(arguments, function(sum, n){ return sum && n; }, true); |
const d = { | |
share: 5, | |
promote: 6, | |
engage: 11, | |
discover: 1 | |
} | |
const total = _(d).values().sum(); | |
const buckets = _(d) |
function compose(...fns) { | |
return x => _.reduceRight(fns, (acc, f) => f(acc), x); | |
} | |
const square = x => x * x; | |
const double = x => x + x; | |
const squareDouble = compose(square, double); | |
const test = compose(); // empty compose acts like identity |
const _ = require('lodash'); | |
function Point(x, y) { | |
return {x, y}; | |
}; | |
const Color = { | |
black: {r: 255, g: 255, b: 255, y: 1} | |
} |