How can I get the debug console to display the actual values of the sorted object?
The result in the VS Code debug console display as below and are non expandable:
[{…}, {…}, {…}, {…}, {…}, {…}]
No debugger available, can not send 'variables'
Here is a simple program outputting a sorted object that I have written in VS Code.
const items = [
{ name: 'Edward', value: 21 },
{ name: 'Sharpe', value: 37 },
{ name: 'And', value: 45 },
{ name: 'The', value: -12 },
{ name: 'Magnetic', value: 13 },
{ name: 'Zeros', value: 37 }
];
// sort by value
items.sort(function (a, b) {
return a.value - b.value;
});
// console.log(items);
Here is the launch.json file:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}