Skip to content

Instantly share code, notes, and snippets.

Sasa Jovanovic bastijan

Block or report user

Report or block bastijan

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 array
function flatt(array, ret) {
/* intialiye empty array ret (used in recursion) */
if (ret===undefined) {
ret = []
for (var i = 0; i < array.length; i++) {
/* check if array element is array */
if (Array.isArray(array[i])) {
/* recursion */
flatt(array[i], ret);
You can’t perform that action at this time.