diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-04-08 22:40:54 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-04-08 22:40:54 +0800 |
| commit | 88e2d65964dcbfd95b712cf4119e3bdf6a25e7c0 (patch) | |
| tree | 1db6428adbf66434e7dece3c9cfc79a59828a53e | |
| parent | d7295c8f71ec67b88f81934fd1561eeaad1107f1 (diff) | |
made const before map
| -rw-r--r-- | main.js | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 +} |
