打字稿在比赛时抱怨

时间:2021-03-08 14:08:06

标签: typescript

我复制了此处找到的代码 Return positions of a regex match() in Javascript?

  var str = "this is a \"quoted\" string as you can 'read'";

  var patt = /'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"/igm;

  while (match = patt.exec(str)) {
    console.log(match.index + ' ' + patt.lastIndex);
  }

在 typescript Playground 中,她为什么抱怨 match var ?

enter image description here

0 个答案:

没有答案