Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Hypercubed / flatten.js
Created April 21, 2016 11:09 — forked from thetutlage/flatten.js
Flatten an array in Javascript without recursion
'use strict'
var Benchmark = require('benchmark')
var suite = new Benchmark.Suite;
var list = [1, 2, 3, [[4]], [[[5]]], [6], [[7]]]
function flattenRecursive (list) {
var flatList = []
list.forEach(function (item) {
@Hypercubed
Hypercubed / LICENSE
Last active May 3, 2017 00:46 — forked from curran/LICENSE
Chiasm Boilerplate (with download buttons)
The MIT License (MIT)
Copyright (c) 2015 Curran Kelleher
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: