Answer the question
In order to leave comments, you need to log in
Eslint swears at the code, what is the best way to write?
Did dynamic addition of buttons in the cart. Here is a working code, only if he swears
iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.eslintno-restricted-syntax
iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.eslintno-restricted-syntax
function frontMenu3() {
const arrayOfLabel = ;
const menu = Telegraf.Extra
.markdown()
.markup((m) => {
const arrr = [];
for (const arr of arrayOfLabel) {
const list = [];
for (subArr of arr) {
list.push(m.callbackButton(subArr, 'your-unic-callback'));
}
arrr.push(list);
}
console.log(arrr);
return m.inlineKeyboard(arrr);
});
return menu;
}
function frontMenu() {
const arrayOfLabel = ;
const menu = Telegraf.Extra
.markdown()
.markup((m) => {
const arrr = [];
arrayOfLabel.forEach((arr) => {
const list = [];
arr.forEach((subarr) => {
list.push(m.callbackButton(subarr, 'your-unic-callback'));
});
arrr.push(list);
});
console.log(arrr);
return m.inlineKeyboard(arrr);
});
return menu;
}
Answer the question
In order to leave comments, you need to log in
ESLint tells you not to use specific syntactic constructs (like for of, with, in to test prototypes), as not everyone likes that sort of thing.
If you prefer to use the for or syntax, then use and supply
/* eslint-disable-next-line */
for (const arr of arrayOfLabel) {
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question