问题描述
而不是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 });
}
我试过了,但我看不到任何值:
解决方法
在 chrome 开发工具控制台中试试这个
[...result];