Node.js - console.log does not show items in array but instead shows [Object]

后端 未结 4 1499
死守一世寂寞
死守一世寂寞 2020-12-11 23:41

I have a problem with logging out the contents of an array inside an object. The actual object looks like this

   var stuff = { accepted: [ \'item1\', \'ite         


        
4条回答
  •  抹茶落季
    2020-12-12 00:27

    If you like Chrome devtools, that folds your json objects and let you observe a lot of things, you can use the --inspect flag:

    node --inspect index.js
    

    The console will then give you an URL and you just have to copy paste in Google Chrome to enjoy Google Chrome console.

    More information on this link

提交回复
热议问题