- Online Prototyping
- User Testing & Feedback
- UI Design Patterns
- Colours & Gradients
- User & Profile Photos
- Stock Photography
- Icons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//solution | |
function flattenArr(arr) { | |
var result = []; | |
arr.forEach(function(e) { | |
if(Array.isArray(e)) { | |
result = result.concat(flattenArr(e)); | |
} else { | |
result.push(e); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var binarySearch = function(array, value, start, end) { | |
var start = start === undefined ? 0 : start; | |
var end = end === undefined ? array.length : end; | |
//recursion base case- start will keep on incrementing to find the value until it reaches the end if it hasn't been found | |
if (start > end) { | |
return -1; | |
} | |
//index at the middle of a binary search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var memory = require('./memory'); | |
//secure javascript program | |
var createArray = function() { | |
var publicLength = 0, publicCapacity = 0, publicPtr = memory.allocate(publicLength); | |
var privateSIZE_RATIO = 3; | |
function publicPush(value) { | |
if(publicLength >= publicCapacity) { | |
privateResize((publicLength + 1) * privateResize); |