Skip to content

Instantly share code, notes, and snippets.

@zoryana94
zoryana94 / flatten-array.js
Created March 29, 2019 14:10
Flatten array
const arr = [[1,2,[3]],4];
function flattenArray(arr = []) {
let flattenedArray = [];
arr.forEach(item => {
if (Array.isArray(item)) {
flattenedArray = [...flattenedArray, ...flattenArray(item)];
} else {
flattenedArray.push(item);
@zoryana94
zoryana94 / introrx.md
Created February 26, 2017 01:41 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing