Contact: aviboots(AT)netvision.net.il
39,880 questions
51,806 answers
573 users
let arr = ["swift", "java", "python", "rust"] let index = arr.firstIndex(where: {$0 == "java"})! print(index) /* run: 1 */
let arr = [1, 4, 7, 8, 10, 19] let index = arr.firstIndex(where: {$0 > 5})! print(index) /* run: 2 */