Tiny simplification making code more brief and readable: in case we create a copy of the same length as original array and copy all the data into it we can use array.clone() instead of hand-made code snippet.