summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-04-08 22:40:54 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-04-08 22:40:54 +0800
commit88e2d65964dcbfd95b712cf4119e3bdf6a25e7c0 (patch)
tree1db6428adbf66434e7dece3c9cfc79a59828a53e
parentd7295c8f71ec67b88f81934fd1561eeaad1107f1 (diff)
made const before map
-rw-r--r--main.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/main.js b/main.js
index a227ac9..304e017 100644
--- a/main.js
+++ b/main.js
@@ -1,3 +1,9 @@
+const inputArea = document.getElementById('input');
+const outputDiv = document.getElementById('output');
+const convertButton = document.getElementById('convert');
+const modeSelect = document.getElementById('mode');
+
+
const map = {
'`': '`',
'~': '`',
@@ -93,11 +99,6 @@ const map = {
'?': '¿'
};
-const inputArea = document.getElementById('input');
-const outputDiv = document.getElementById('output');
-const convertButton = document.getElementById('convert');
-const modeSelect = document.getElementById('mode');
-
convertButton.addEventListener('click', () => {
const mode = modeSelect.value;
const inputText = inputArea.value;
@@ -120,4 +121,4 @@ function convertNormal(data, map) {
function convertReverse(data, map) {
return data.split('').map(char => map[char] || char).join('');
-} \ No newline at end of file
+}