First iteration of javascript hamming exercise