ChatGPT Const to Var switch for Javascript snippets

ChatGPT doesnt allow changing Const to Var to debug JS easily. This script solves the problem.

Ajankohdalta 17.3.2023. Katso uusin versio.

Tekijä
Joan Doan
Arvostelut
0 0 0
Versio
1.0.3
Luotu
17.3.2023
Päivitetty
17.3.2023
Size
4,35 kt
Lisenssi
GPL-3.0-or-later
Käytössä

When ChatGPT outputs javascript snippets, it sometimes does not allow you to change the variables types to from const to var, so debugging and testing the code in js-console becomes complex(running the script multiple times gives errors oа re-definition variables). This userscript solves the problem by extending code snippets in ChatGPT.
New Buttons:
[Const/Var] - switches all const variable definitions to var, and back.
[COPY] - copies the code snippet (Use it instead of the standard copy button)
This script also adds ability to switch variable types (const/var/let) by clicking on them right in the code.
Just set up the types and click [COPY]. Testing code in javascript-console becomes a lot easier.

Don't copy code using standard button [Copy code], because it copies without any changes. Use new [COPY] button.

长期地址
遇到问题?请前往 GitHub 提 Issues。