Shelley
0
Q:

cache variables that need calculation

// In the case of a jQuery selector, we could cache the DOM element.

let navright = document.querySelector('#right'); 
let navleft = document.querySelector('#left'); 
let navup = document.querySelector('#up'); 
let navdown = document.querySelector('#down');
0

New to Communities?

Join the community