Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
VS code debug - is replacing object values with ellipses. How to show object values in debug?

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": []
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Important: This solution only works if you are using Node.js.

If you are using Node.js, you can use the built-in util.inspect() function.

First, you have to import it using require().

const util = require("util");

Then, you can call the inspect function. You need to pass in your object as a parameter.

const inspected = util.inspect(obj);
console.log(inspected);

Then, you can easily see the object without it being condensed! For more information, see the util.inspect() documentation.


If you are not using Node.js, you can use JSON.stringify(). You can simply use it as so, passing the object as a parameter.

const obj = [
  { name: "Edward", value: 21 },
  { name: "Sharpe", value: 37 },
  { name: "And", value: 45 },
  { name: "The", value: -12 },
  { name: "Magnetic", value: 13 },
  { name: "Zeros", value: 37 }
];

console.log(JSON.stringify(obj));

This should allow you to inspect it properly.

about 4 years ago · Juan Pablo Isaza Report

0

Stringify worked but the output for mine is ugly AF! vscode really sucks in this regard! enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!