Comment copier tous les éléments d'un tableau sauf le dernier en JavaScript

// how to copy all the elements of an array except the last one in javascript
const initial = arr => arr.slice(0, -1);
console.log(initial([1, 2, 3])); // [1, 2]
Chetan Nada