function CollisionDetector() {
};

CollisionDetector.prototype.check = function(object1, object2){
    let all = object2.border
    object1.border.forEach(function(element1){
	all.push(element1);
    })

    function arrHasDupes( A ) { 
	var i, j, n;
	n = A.length;

	for (i=0; i<n; i++) {                
            for (j=i+1; j<n; j++) {          
		if (String(A[i]) === String(A[j])) return true;
	    }}
	return false;
    }

    return arrHasDupes(all);
}


module.exports = CollisionDetector;

function CollisionDetector() {
};

CollisionDetector.prototype.check = function(object1, object2){
    let all = object1.border.concat(object2.border)

    return checkForDups(all);
}

var checkForDups = function(array) { 
    var i, j, n;
    n = array.length;

    for (i=0; i<n; i++) {                
        for (j=i+1; j<n; j++) {          
	    if (String(array[i]) === String(array[j])) return true;
	}}
    return false;
}



module.exports = CollisionDetector;

Fix collision detector to not modify object
Fix collision detector to not modify object

Previously the collision detector was using an each loop to join the two
object arrays being analyzed for impact. This resulted in modification
to the objects themselves.

Now the concat method is used which prevents such modification.
