will this replace the item found in `it.items` wit...
# getting-started
o
will this replace the item found in
it.items
with a new object whose
toggled
variable is now changed?
Copy code
it.items.map { item ->
    item.copy(toggled = createSearchParams?.condition?.contains(item.itemValue)!!)
}
👌 2
m
yes, this will create a new lists of items where each item is a new one. And maybe you should change the
!!
at the end by
?: false
to avoid a NPE
o
Thanks
p
This will not modify the list
it.items
in place though if that is what you were expecting.