JavaScript, Javascript Tips, Interview Questions, Datastrucutre, Javascript Interview.
customInArray = (sortedArray, key) => { let start = 0; let end = sortedArray.length - 1; while (start <= end) { let middle = Math.floor((start + end) / 2); if (sortedArray[middle] === key) { return true; } else if (sortedArray[middle] < key) { start = middle + 1; } else { end = middle - 1; } }