Quick question. I just came across the following in a JS file:
if (0) {
// code
}
What’s the purpose of this if statement? Which cases would the code execute? It currently doesn’t run the code in the if clause.
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.
It looks like an artifact of the development process. Wrapping code like that gives you a quick, 1-character way to effectively comment out a block of code. It’s quicker to toggle than a typical multi-line comment.