function intersection( list1, list2 ) {
	var out;
	var M;
	var N;
	var v;
	var i;
	var j;
	var k;

	M = list1.length;
	N = list2.length;

	out = [];
	k = 0;
	for ( i = 0; i < M; i++ ) {
		if ( k >= N ) {
			break;
		}
		v = list1[ i ];
		for ( j = k; j < N; j++ ) {
			if ( v === list2[ j ] ) {
				k = j + 1;
				out.push( v );
				break;
			}
		}
	}
	return out;
}
Returns the intersection of two sorted lists.

@private
@param {ArrayLikeObject} list1 - first sorted list
@param {ArrayLikeObject} list2 - second sorted list
@returns {ArrayLikeObject} result

@example
var list1 = [ 'a', 'b', 'c', 'd' ];
var list2 = [ 'b', 'd', 'e' ];

var out = intersection( list1, list2 );
// returns [ 'b', 'd' ]