how to print large array fully in chrome console?

前端 未结 3 1793
悲&欢浪女
悲&欢浪女 2021-02-02 06:43

I want to print an array (uniqueNames) in the Chrome Console:

> console.log(uniqueNames)

but the problem I come across is that after

<
相关标签:
3条回答
  • 2021-02-02 06:47

    just join all the elements, separated in string with "," :

    uniqueNames.join("\",\"")
    
    0 讨论(0)
  • 2021-02-02 06:53

    I was looking for console.table(array):

    0 讨论(0)
  • 2021-02-02 07:08

    To print the full array in the console you can do : console.log(JSON.stringify(uniqueNames))

    0 讨论(0)
提交回复
热议问题