how tp get 2 md element of array in js code example
Example 1: array cut only last 5 element
arr.slice(Math.max(arr.length - 5, 0))
Example 2: Copy the first two array elements to the last two array elements
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.copyWithin(2, 0);