Looking for a way to organize variables inside vsCode. Similar to the way that you can collapse a function in the workspace, I would like to be able to collapse a long list of variables ...
var x = 1
var y = 2
var z = 3
var w = 4
var v = 5
//etc.
I can think of 2 hacks:
Code Block (important! be careful with variables scope)
Object Literal
Example of Code Block:
{
const x = 10;
const y = 20;
}
Example of Object Literal:
const variablesNamespace = {
x: 10,
y: 10
}
console.log(variablesNamespace.x) // output 10