Cleanup _.xor patch and add a unit test.

This commit is contained in:
John-David Dalton
2013-12-06 20:34:59 -08:00
parent 64fc924357
commit 51698944e0
9 changed files with 92 additions and 81 deletions

View File

@@ -2914,12 +2914,13 @@
function compact(array) {
var index = -1,
length = array ? array.length : 0,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result.push(value);
result[resIndex++] = value;
}
}
return result;