let arr = [[LIST_WITH_FILE_CONTENT]];
const punct = [[SYMBOLS]];
const numStrWithPunctEnd = 3;
const index = arr.findIndex(function(n, i, a) {
return this.every(m => punct.includes(a[i + m].slice(-1)));
}, [...Array(numStrWithPunctEnd).keys()]);
const result = index !== -1 ? arr.slice(index).join('\n') : arr;
[[LIST_WITH_FILE_CONTENT]]=result;
let str = ["двенадцать яблок", "Апельсин.", "Слива.", "два ананаса.", "семь киви."];
const punct = [[SYMBOLS]];
const numStrWithPunctEnd = 3;
const arr = str.split('\n');
const index = arr.findIndex(function(n, i, a) {
return this.every(m => punct.includes(a[i + m].slice(-1)));
}, [...Array(numStrWithPunctEnd).keys()]);
const result = index !== -1 ? arr.slice(index).join('\n') : str;
console.log(result);
const str = [[LIST_WITH_FILE_CONTENT]];
const punct = [[SYMBOLS]];
const numStrWithPunctEnd = 3;
const arr = str.split('\n');
const index = arr.findIndex(function(n, i, a) {
return this.every(m => punct.includes(a[i + m].slice(-1)));
}, [...Array(numStrWithPunctEnd).keys()]);
const result = index !== -1 ? arr.slice(index).join('\n') : str;
[[LIST_WITH_FILE_CONTENT]]=result;
When I consider every thing that grows
Holds in perfection but a little moment,
That this huge stage presenteth nought but shows
Whereon the stars in secret influence comment;
When I perceive that men as plants increase,
Cheered and cheque'd even by the self-same sky,
Vaunt in their youthful sap, at height decrease,
And wear their brave state out of memory
const list = [[LIST_WITH_FILE_CONTENT]];
const uniqueList = list.filter((word, index) => {
const regexp = new RegExp(word, 'i');
for (let i = 0; i < list.length; ++i) {
if (!regexp.test(list[i])) continue;
if (i === index) return true;
return false;
}
});
[[LIST_WITH_FILE_CONTENT]]=uniqueList;
[[SPISOK_TEST]] = [[SPISOK_TEST]].filter(function(line){
return [[BLACK_LIST]].every(function(forbiddenWord) {
return line.toLowerCase().indexOf(forbiddenWord.toLowerCase()) === -1;
});
});
<code>@for /f %%i in ('set /a 1^^^<^^^<10') do @for %%j in ("{{папка с txt файлами}}\*.txt") do @if %%~zj leq %%i del "%%j"</code>
@for /f %%i in ('set /a 2^^^<^^^<10') do @for %%j in ("{{папка с txt файлами}}\*.txt") do @if %%~zj leq %%i del "%%j"
var arr = [], f;
for(var i=0;i<VAR_SODERGIMOE_LISTA_V_2D.length;i++){
f = true;
for(var j=0;j<arr.length;j++){
if(VAR_SODERGIMOE_LISTA_V_2D[i][0] == arr[j][0]){
f = false;
break;
}
}
if(f){
arr.push(VAR_SODERGIMOE_LISTA_V_2D[i]);
}
arr.sort(function(a, b) {
return b[1] - a[1];
})
}
VAR_SODERGIMOE_LISTA_V_2D = arr;
[[LIST_WITH_FILE_CONTENT]] = [[LIST_WITH_FILE_CONTENT]].filter(function(line){
return [[BLACK_LIST]].every(function(forbiddenWord) {
return line.indexOf(forbiddenWord) === -1;
});
});
Ошибка: