SteveSanderson/knockout — pull request #937 by viceroypenguin (2013-04-26 16:09:37+00:00)
Title: Add support for providing comparison function to compareArrays.

I recently found myself in need of using the `compareArrays` function with object arrays instead of simple arrays. As such, I would like to provide a comparison function to the `compareArrays` function that make comparisons quicker and more "accurate" from the perspective of keys.

I've updated the `compareArrays` function to accept the comparison function and use it when comparing between two elements in each array. I've also added a default function that matches current behavior (`===`).

There are two new specs in the Compare Arrays area. This change passes all of the existing specs as well as the new specs. One spec is for proof of comparison, similar to the existing functions. The other is to verify only the comparison function is used to identify differences between the two arrays (though this should not be common practice).