My editor (Geany) changes the colour of a comment when a comment starts with /*!. What’s the difference between /* ... */ and /*! ... */?
My editor ( Geany ) changes the colour of a comment when a comment
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The ! prevents YUI compressor from removing the comment when it compresses. (It just removes 1 ! instead. Multiple !’s mean you can compress multiple times without loss of the comment.) It’s just an extension, but not part of javascript itself.
Documentation is here. Search for ‘C-style comments’.
also, I’m not aware of any other compressors that respect the !. Packer, closure compiler, shrinksafe, and jsmin do not respect it at least.