Skip to content

Instantly share code, notes, and snippets.

View codescype's full-sized avatar

Codescype codescype

View GitHub Profile
/**
* @func arrayFlatten Flatten an nested arrays
* @param {Array} arr An Array to be flattened
* @param {Array | undefined} currentList
*/
function arrayFlatten(arr, currentList) {
if (!currentList) {
currentList = [];
}