Skip to content

Instantly share code, notes, and snippets.

Dragan Smiljanic draganSm

Block or report user

Report or block draganSm

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
* Flattens the giving array recursively
* @param array
* @returns {Array}
export default function flattenArray(array, result = []) {
for (const element of array) {
if (Array.isArray(element)) {
flattenArray(element, result);
You can’t perform that action at this time.