Skip to content

Commit f84b9c2

Browse files
committed
PR comments. Move expected pin code out of checkPin function
1 parent 9b63c2f commit f84b9c2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Exercises/4-curry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
// Check 4 digit pin.
4-
const checkPin = (...code) =>
5-
code.join('') === '4967';
4+
const EXPECTED_PIN = '4967';
5+
const checkPin = (...code) => code.join('') === EXPECTED_PIN;
66

77
// Define function curry that accepts the length of the function
88
// (amount of function arguments) and the function.

Exercises/5-chaining.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

33
// Check 4 digit pin.
4-
const checkPin = (ch1, ch2, ch3, ch4) =>
5-
[ch1, ch2, ch3, ch4].join('') === '4967';
4+
const EXPECTED_PIN = '4967';
5+
const checkPin = (...code) => code.join('') === EXPECTED_PIN;
66

77
// Impement function press
88
// that allows to enter pin code by one character,

0 commit comments

Comments
 (0)