บทความนี้สาธิตการหา positive integer ที่เล็กที่สุด (เริ่มจาก 1) ที่ไม่ปรากฏในอาร์เรย์ ตัวอย่าง output: 5 ตัวอย่างโค้ด { let count = 1; if (!arr?.length) { return count; } while (arr.indexOf(count) !== -1) { count++; } return count; }; console.log(findSmallestMissing(arr));