How to show full object with VSCode Code Runner in the OUTPUT section?

191 views Asked by At

When running JS code via Code Runner, my output is often abbreviated to [Object] and I am unable to see the full result of running a JS function. Is there a setting that allows full console logging of the full output rather than just abbreviating a lot of it into [Object]? The image below is my console log output of a linked list based toy problem with the output being the linked list as an object. On a similar note, is there a more preferred method to run code for these toy problem / leetcode style problems in VSCode or is Code Runner sufficient? enter image description here

1

There are 1 answers

0
Nguyễn Minh nhật On

you can use:

  console.log(JSON.stringify(value, null, 2));