Skip to content

Commit ac75f79

Browse files
committed
Fix naming to consistent
1 parent e97d4ad commit ac75f79

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

JavaScript/2-consistent.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const inconsistent = (a, b) => {
3+
const consistent = (a, b) => {
44
if (a < 0) throw new Error('Expected positive "a"');
55
if (b > 9) return b;
66
if (a === b) return -1;
@@ -10,35 +10,35 @@ const inconsistent = (a, b) => {
1010
};
1111

1212
try {
13-
const y1 = inconsistent(-1, 7);
13+
const y1 = consistent(-1, 7);
1414
console.log({ y1 });
1515
} catch (error) {
1616
console.error(error.message);
1717
}
1818

1919
try {
20-
const y2 = inconsistent(5, 20);
20+
const y2 = consistent(5, 20);
2121
console.log({ y2 });
2222
} catch (error) {
2323
console.error(error.message);
2424
}
2525

2626
try {
27-
const y3 = inconsistent(5, 5);
27+
const y3 = consistent(5, 5);
2828
console.log({ y3 });
2929
} catch (error) {
3030
console.error(error.message);
3131
}
3232

3333
try {
34-
const y4 = inconsistent(5, 7);
34+
const y4 = consistent(5, 7);
3535
console.log({ y4 });
3636
} catch (error) {
3737
console.error(error.message);
3838
}
3939

4040
try {
41-
const y5 = inconsistent(5, '7');
41+
const y5 = consistent(5, '7');
4242
console.log({ y5 });
4343
} catch (error) {
4444
console.error(error.message);

0 commit comments

Comments
 (0)