title: How to convert/transform a collection to another collection by element's property?
body: <p>If I have a collection of an object in Kotlin, is there a quick way to get a collection of a certain property of those objects? I looked at a list of <a href="https://antonioleiva.com/collection-operations-kotlin/" rel="noreferrer">collection operations for Kotlin</a>, but nothing stood out for me (but I may have overlooked something)</p>
  
  <p>In python it would be akin to:</p>
  
  <p><code>[person.name for person in persons]</code></p>
  
  <p>And I'd prefer to use a collections function instead of doing:</p>
  
  <pre><code>var nameMap = mutableListOf&lt;String&gt;()
  persons.forEach{person -&gt; nameMap.add(person.name)}
  </code></pre>
  
  <p>I'm pretty lacking in knowledge of filtering/lambda functions and anything other than list comprehension, so apologies if this is a simple question</p>