I have initialized several variables in the global scope in a JavaScript file:
var moveUp, moveDown, moveLeft, moveRight; var mouseDown, touchDown; >
var moveUp, moveDown, moveLeft, moveRight; var mouseDown, touchDown;
Put the varible in an array and Use a for Loop to assign the same value to multiple variables.
myArray[moveUP, moveDown, moveLeft]; for(var i = 0; i < myArray.length; i++){ myArray[i] = true; }