Is it possible to destroy an object with the names of user variables?
TypeScript
const { top } = { top: 1000 };
Javascript
var top = { top: 1000 }.top;
But I want something like the one shown below (doesn't work).
TypeScript
const { top as elementTop } = { top: 1000 };
Javascript
var elementTop = { top: 1000 }.top;
source
share