Skip to content

Commit c3cfc19

Browse files
committed
Enable ES2021 in jsconfig.json & use replaceAll in day 24 challenge
1 parent 2381324 commit c3cfc19

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"checkJs": true,
44
"module": "es6",
5-
"target": "es2020"
5+
"target": "es2021"
66
},
77
"exclude": ["node_modules"]
88
}

src/day24/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export default function checkIsSameTree(treeA, treeB) {
1818
const inverseTree = function (tree) {
1919
return JSON.parse(
2020
JSON.stringify(tree)
21-
.replace(/left/g, 'tmp')
22-
.replace(/right/g, 'left')
23-
.replace(/tmp/g, 'right')
21+
.replaceAll('left', 'tmp')
22+
.replaceAll('right', 'left')
23+
.replaceAll('tmp', 'right')
2424
)
2525
}
2626

0 commit comments

Comments
 (0)