Many style guides and idiomatic JavaScriptThe naming of variables (as well as code in other languagesand constants) callcould be improved. I see MARIO used for constantsa variable that corresponds to be named in all capsan Image object, as well as mario that is used as the path to the image (as this code does for values likei.e. ITERATION'../images/mario.png' which is actually imported and thus would likely be an object bytemap). Typically, all capitals corresponds to constant values (e.g. string literals) so things imported canit would be more appropriate to have the path to the image in all capscapitals - e.g. block could be changed to BLOCKMARIO_SRC andor marioPATH_TO_MARIO could be changed. Then the variable that corresponds to MARIO, which would then require changing the casing ofImage is still technically mutable despite being declared with const MARIO = new Image() so it would be more appropriate to const mario = new Image()use camel-case characters for it. Perhaps a more appropriateless confusing name would be marioImagemarioImg. And to avoid confusion, the constant for the source could be MARIO_SRC
const mariomarioImg = new Image(); mariomarioImg.src = MARIO_SR;MARIO_SRC;