I am using following code to quickly assign window.getComputedStyle to a variable:
const {
width,
height,
left
} = window.getComputedStyle(document.querySelector('canvas'));
console.log(width, left, height)
<canvas></canvas>
But when I want to declare top, it returns:
Uncaught SyntaxError: Identifier top has already been declared
const {
width,
height,
left,
top
} = window.getComputedStyle(document.querySelector('canvas'));
console.log(width, left, height)
<canvas></canvas>
What am I missing?
Thanks.