是否可以使用 Chrome 开发工具查看内部迭代器内容

问题描述

而不是stringify match result通过代码来做

const string = "I am learning JavaScript not Java.",re = /Java[a-z]*/gi,result = string.matchAll(re);

for (let match of result) {
  console.log({ ...match });
}

我试过了,但我看不到任何值:

enter image description here

解决方法

在 chrome 开发工具控制台中试试这个

[...result];