How can I get the full object in Node.js's console.log(), rather than '[Object]'?

前端 未结 17 2934
一向
一向 2020-11-22 02:59

When debugging using console.log(), how can I get the full object?

const myObject = {
   \"a\":\"a\",
   \"b\":{
      \"c\":\"c\",
      \"d\":         


        
17条回答
  •  青春惊慌失措
    2020-11-22 03:16

    If you're looking for a way to show the hidden items in you array, you got to pass maxArrayLength: Infinity

    console.log(util.inspect(value, { maxArrayLength: Infinity }));
    

提交回复
热议问题