Skip to content

Instantly share code, notes, and snippets.

View C-Johnston's full-sized avatar

Chad Johnston C-Johnston

  • Cincinnati, Ohio
View GitHub Profile
//Flatten a nested array.
//You must account for varying levels of nesting.
function steamroller(arr) {
var flatenArr=[], i;
function checkNested(arr2) {
for (var x=0;x<arr2.length;x++) {
if (!Array.isArray(arr2[x]))
flatenArr.push(arr2[x]);