使用 Visual Studio Code 打印完整数组项

wri*_*per 4 terminal visual-studio-code

在此输入图像描述

我使用 Visual Studio Code,我想打印所有数组数据,但它只显示...更多项目消息。有什么方法可以显示这一切吗?我在 stackoverflow 上搜索但找不到解决方案。

我使用默认的 cmd 终端,它与 Node.js 一起运行

LBa*_*ald 5

您可能尝试迭代数组内的每个元素,然后单独打印。请参阅下面的代码:

arr = [2, 54, 72, ... ] // your big array
arr.forEach(e => console.log(e))
Run Code Online (Sandbox Code Playgroud)

另请参阅https://www.geeksforgeeks.org/node-js-foreach-function/其中上面的代码被采用