Identifier has already been declared error using HTML-snippet

When I use an HTML-snippet to add some Javascript and I'm declaring a constant, I get this error. Is there a way to “start” over again, so I can use the same JS-file over and over again? I want to use this: const input = Array.from(document.querySelectorAll('input')); const textarea = Array.from(document.querySelectorAll('textarea')); const allInputs = input.concat(textarea); allInputs.forEach(etc.....) instead of this: Array.from(document.querySelectorAll('input')).concat(Array.from(document.querySelectorAll('textarea'))).forEach(etc.....) Thanks in advance!
1 answers

Const cannot be changed or reassigned, so I think if you use let or var instead of const you should be fine.