function fuzzysearch (needle, haystack) { var tlen = haystack.length; var qlen = needle.length; if (qlen > tlen) { return false; } if (qlen === tlen) { return needle === haystack; } outer: for (var i = 0, j = 0; i < qlen; i++) { var nch = needle.charCodeAt(i); while (j < tlen) { if (haystack.charCodeAt(j++) === nch) { continue outer; } } return false; } return true; }這里outer:for(……的寫(xiě)法規(guī)范嗎?
這個(gè)javascript函數(shù)中的寫(xiě)法符合規(guī)范嗎?
白衣染霜花
2018-09-07 15:09:32