Does `.sliceArray()` create a new array coping the...
# getting-started
a
Does
.sliceArray()
create a new array coping the original array or does it just keep a reference to it? That info is difficult to find. Also anyone know where I can find the actual source code for the implementation? Thanks.
e
the source should be linked in intellij, but you can also see it at https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/common/src/generated/_Arrays.kt
👍 1
and it's always a copy. arrays are nearly-primitive objects that don't have any mechanism for sharing slices of themselves
👍 1
a
@ephemient Thanks a lot.