Add a comment here saying why you're slicing at index 0 to return another copy of the array. It doesn't make too much sense at first glance unless you know it has to do with undo/redo.