Skip to content

Instantly share code, notes, and snippets.

cloudle cloudle

Block or report user

Report or block cloudle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View flatten.js
//@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];
You can’t perform that action at this time.