有没有办法跳转到特定行?

Is there a way to jump to specific line?

如何跳过"First Message"或从第n行开始异步函数?


async function oneByOne() {
  await talk("First Message");
  await talk("Second Message?");
  await talk("Last Message?");
}

有一个消息数组并循环遍历它们

async function oneByOne(startIndex) {
        const messages = ["first message", "second message?", "last message?"];
        while (startIndex < messages.length) {
            await talk(messages[startIndex]);
            startIndex++;
        }
}

现在,您可以输入 oneByOne 一个索引作为起点。如果你说 oneByOne(1),它会跳过索引 0