Use const keyword for constant arrays

This commit is contained in:
Jimmy Cai 2022-01-18 22:06:40 +00:00 committed by GitHub
parent 36da8b3254
commit bd473b0314

View File

@ -76,7 +76,7 @@ class Search {
lastIndex = 0,
charCount = 0;
let resultArray: string[] = [];
const resultArray: string[] = [];
while (i < matches.length) {
const item = matches[i];
@ -139,7 +139,7 @@ class Search {
}).join('|'), 'gi');
for (const item of rawData) {
let titleMatches: match[] = [],
const titleMatches: match[] = [],
contentMatches: match[] = [];
let result = {