Skip to content

Commit

Permalink
fix bug on ClH
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Nov 28, 2017
1 parent 26a2743 commit 22244a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/__tests__/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('sort an array', () => {
});

test('sort an array HCl', () => {
let atoms = ['H', 'Cl'];
let atoms = ['Cl', 'H'];
atoms.sort((a, b) => atomSorter(a, b));
expect(atoms).toEqual(['H', 'Cl']);
});
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function atomSorter(a, b) {
if (a === 'C') return -1;
if (b === 'C') return 1;
if (a === 'H') return -1;
if (b === 'H') return 1;
if (a < b) return -1;
return 1;
}
Expand Down

0 comments on commit 22244a2

Please sign in to comment.