library-understanding

Why does the definition of Array.map in Scala is "throw new Error()"

The source code of map for Array is: override def map[B](f: A => B): Array[B] = throw new Error() But the following works: val name : Array[String]= new Array(1) name(0)="Oscar" val x = name.map { ( s: String ) => s.toUpperCase } // returns: x: Array[java.lang.String] = Array(OSCAR) ...