Skip to content

Instantly share code, notes, and snippets.

//@flow *Ecmascript 6 syntax & require flow syntax checking before build;
function flatten (source:Array<any>) : Array<number> {
return source.reduce((previous, current) => {
let next;
if (Array.isArray(current)) {
next = flatten(current);
} else if (typeof current == 'number') {
next = [current];
Just atom settings..