Permutation Game Hackerrank Javascript Test For Null