function hasDuplicate(orderIds) { const seen = []; for (const orderId of orderIds) { if (seen.includes(orderId)) { return true; } seen.push(orderId); } return false; }