Ch8n
03/14/2021, 8:32 AMelementAt()
function on collections, I started to wonder which one is better for getting values, elementAt()
or get()
.. Found only this line element at is useful for collections that do not provide indexed access, or are not statically known to provide one.
, so does that mean elementAt()
is useful for non-index-based collection? like LinkedList? maps? graphs? Even examples show https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/element-at.html arrays and List sample not other once.. is it because there is only list, set, and map in collections of Kotlin?ephemient
03/14/2021, 9:07 AMCh8n
03/14/2021, 9:34 AM