https://kotlinlang.org logo
#react
Title
d

Dmitriy Malayev

06/25/2023, 11:49 PM
Why doesn't this work?
Copy code
val moreColors = arrayListOf("blue, red, yellow, pink, teal, red")

// Create a new array list to store the colors without "red"
val newColors = moreColors.filter { it != "red" }

// Print the newColors array list
println(newColors)
k

kqr

06/26/2023, 6:37 AM
shouldn't be
arrayListOf("blue", "red", "yellow", "pink", "teal", "red")
?
b

Big Chungus

06/26/2023, 8:50 AM
Works just fine
d

Dmitriy Malayev

06/29/2023, 3:07 PM
No idea why it wasn't working for me initially
Thanks
2 Views