Alright guys, I'm having the error
Uncaught TypeError: Cannot read property 'left' of undefined
When using this code
var y=document.getElementsByClassName('snake-snakebody-block snake-snakebody-alive snake-snakebody-alive')
//console.log(y.style)
console.log(y.style.left)
console.log(y.style.top)
on this element
<div class="snake-snakebody-block snake-snakebody-alive snake-snakebody-alive" style="left: 40px; top: 580px; width: 20px; height: 20px; z-index: 5;"></div>
And I'm at a loss. how can I fix