I realize there is no way to get a dictionary of local variables in a javascript function, and no equivalent of python's locals(). However, is there a way to write a function that would assist in this. For example, something like:
var a = 1;
var b = 2;
var output = locals(a, b);
console.log(output);
And output would be a dictionary with all the variables:
{
"a": 1,
"b": 2
}
Or, any other way apart from me manually creating a map, and inserting each field.