05 Aug 2021   javascript


const letters = ["a", "b", "d"];
console.log(letters.slice(0, -1).concat("c"));
=> [ "a", "b", "c" ]

console.log(letters)
=> ["a", "b", "d"]