Skip to content

Commit ffade6b

Browse files
committed
Refactory to use literal string
1 parent 552cca4 commit ffade6b

File tree

2 files changed

+341
-2
lines changed

2 files changed

+341
-2
lines changed

Project-Euler/Problem022.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
export function namesScores (namesTxt) {
18-
namesTxt = namesTxt.replaceAll('"', '')
18+
namesTxt = namesTxt.replaceAll(/"|\n/g, '')
1919
const names = namesTxt.split(',')
2020

2121
names.sort((a, b) => (a > b) - (a < b))

0 commit comments

Comments
 (0)