title: How to apply map function to array in Kotlin and change its values?
body: <p>I am working with this code.</p>
  
  <pre><code>fun main(args : Array&lt;String&gt;){
  
      val someArray : Array&lt;Int&gt; =  arrayOf(3,53,2,521,51,23,512,34,124);
  
      println("Original array is ")
  
      someArray.forEach {print("$it , ")}
  
      someArray.map({num -&gt; num*2})
  
      println("Changed array is ")
  
      println()
  
      someArray.forEach { print("$it , ") }
  }
  </code></pre>
  
  <p>But the map function does not seem to work. Here is what it prints</p>
  
  <p>Original array is 
  3 , 53 , 2 , 521 , 51 , 23 , 512 , 34 , 124 , Changed array is </p>
  
  <p>3 , 53 , 2 , 521 , 51 , 23 , 512 , 34 , 124 , </p>
  
  <p>My question is why is the array not doubling the value of its elements? What i am i missing here?</p>