irisan eliminar el ultimo caracter

const str = "DelftStacks";
const str2 = str.substring(0, str.length - 1);
console.log(str2);
Jose Campos