MCQs > IT & Programming > JavaScript > When toggling a variable, its cycle must be 0 and 1. When the variable's active value is 0, the next value should be 1, and when the variable's active value is 1, the next value should be 0. Considering the scenario above, which of the following is correct?

JavaScript MCQs

When toggling a variable, its cycle must be 0 and 1. When the variable's active value is 0, the next value should be 1, and when the variable's active value is 1, the next value should be 0. Considering the scenario above, which of the following is correct?

Answer

Correct Answer: q = 1 - q;

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it