Skip to content

Instantly share code, notes, and snippets.

View dfsq's full-sized avatar

Aliaksandr Astashenkau dfsq

View GitHub Profile
@dfsq
dfsq / merge-sorted-arrays
Last active August 29, 2015 13:57
Merge two sorted arrays
function mergeArrays(arr1, arr2) {
var out = [],
i = 0,
j = 0,
length = arr1.length;
while (arr2[j] < arr1[0]) {
out.push(arr2[j++]);
}