If you are trying to get sprites and it's relevent varibles in Javascript, try to use this:
// get and print sprite's name and it's value
var sprites = ide.sprites.contents;
for(let i = 0; i < sprites.length; i ++) {
var sprite = sprites[i];
spriteName = sprite['name'];
spriteVars = sprite.variables.vars
console.log('spriteName:', spriteName);
console.log('spriteVar:', spriteVars);
}