Good day, i\'m stuck figuring out how to get a single object from a list, i did google but all the topics show how to return a List with sorted objects or somet
List
If you don't want to deal with null objects, try this:
val index = myList.indexOfFirst { it.userId == id } // -1 if not found if (index >= 0) { val user = myList[index] // do something with user }