Solución
solution.tsTypeScript
// Convierte appendItem a una función pura
// Debe retornar un nuevo array sin mutar el original
function appendItem<T>(arr: T[], item: T): T[] {
// arr.push(item);
const arrWithItem: T[] = [...arr];
arrWithItem.push(item);
return arrWithItem;
}
export { appendItem };0respuestas