Skip to content

Commit 73cd02d

Browse files
gwbaik9717obzva
andauthored
refactor: Remove unnecessary function
Co-authored-by: Dongyeong Chon <[email protected]>
1 parent 063cbd4 commit 73cd02d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

valid-palindrome/gwbaik9717.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
* @return {boolean}
77
*/
88
var isPalindrome = function (s) {
9-
const normalize = (s) => {
10-
return s.toLowerCase().replace(/[^a-z0-9]/g, "");
11-
};
12-
13-
const normalized = normalize(s);
9+
const normalized = s.toLowerCase().replace(/[^a-z0-9]/g, "");
1410
const reversed = normalized.split("").reverse().join("");
1511

1612
return normalized === reversed;

0 commit comments

Comments
 (0)