I have initialized several variables in the global scope in a JavaScript file:
var moveUp, moveDown, moveLeft, moveRight;
var mouseDown, touchDown;
I need to set all of these variables to false. This is the code I currently have:
moveUp = false;
moveDown = false;
moveLeft = false;
moveRight = false
mouseDown = false;
touchDown = false;
Is there any way that I can set all of these variables to the same value in one line of code, or is the code I currently have the best way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…