Skip to content

Instantly share code, notes, and snippets.

View w3debugger's full-sized avatar
🎯
Focusing

Muhammad Umar w3debugger

🎯
Focusing
View GitHub Profile
@w3debugger
w3debugger / flattenArray.js
Created June 19, 2016 10:58
Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]
function flatten(array) {
var idx,
temp = [array],
lastIdx = [-1],
result = [];
while(temp.length) {
array = temp.pop();
idx = lastIdx.pop() + 1;
@w3debugger
w3debugger / Login Screen.markdown
Last active February 16, 2016 22:17 — forked from anonymous/Login Screen.markdown
Login Screen