Typescript, Generics, Polymorphism.
array.slice().reverse(); const numbers = [1, 2, 3, 4, 5]; const reversedNumbers = reverseArray(numbers); console.log(reversedNumbers); // [5, 4, 3, 2, 1] const words = ["TypeScript", "is", "fun"]; const reversedWords = reverseArray(words); console.log(reversedWords); // ["fun", "is", "TypeScript"]