Is there a way to do something like this in Javascript?
/*
code
/* Multiple
line
comment */
more code
*/
When I test, I often need to comment out large chunks of code that already have multiline comments.
I think your IDE have find and replace option.
Add /*
at starting
and */
at ending
Within the code block
Replace */
with *//*
then to if you want to remove the comments you made :
Remove /*
at starting, Remove */
at ending
Within the code block
Replace *//*
with */
This is not a direct answer, per-se. But the fact that block comments can't also block nested comments is a horrifically lame situation to begin with. The answer is to fix JS.
The obvious rule: EVERYTHING between the comment tags is to be treated as a comment. Period. To re-interpret commented text as functional in any way is just not sane. Commented text should not have any functional symbology.... it should not be getting parsed at all.... no excuses. Commented text should be absolutely dead. Non-funcitonal.
In VS studio I was able to highlight the lines of code and use 'ctrl + /' and it toggles the lines of code to either be commented out or back in. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With