尋找一種更簡潔的方法來編寫這個 for 循環。我打算使用 continue; 并意識到 .forEach 不喜歡這種語法。const findNoOptions = array => { let str = ""; for (let i = 1; ; i += 1) { str = "Z".repeat(i); let found = false; array.forEach(element => { if (element.toUpperCase().includes(str)) { found = true; } }); if (!found) { break; } }};
有沒有辦法清理這段代碼?它的功能,但它被黑客攻擊和丑陋
森林海
2021-10-14 15:44:58