exercism/xjavascript — pull request #66 by byelipk (2014-11-27 06:47:25+00:00)
Title: correctly compute hamming for strands of unequal length

Since the hamming distance is equal to the difference between two homologous DNA strands I wanted to add a test that checked the solution was properly limiting the upper bound of the point comparisons.

This cropped up in a nitpick for code like this

`var len = Math.min(strand1.length, strand2.length);`

which suggested the use of `Math.max()` over `Math.min()`. With the present test suite,`Math.max()` makes all the tests pass, but it inflates the hamming distance because it includes point comparisons that should not be included.

Any thoughts?