remove last digit in array js code example
Example 1: js array delete last
array.pop()
Example 2: how to remove last digit from number in javascript
var str = "stackoverflow";
str = str.substring(0, str.length - 1);
console.log(str);
Example 3: how to remove the last element of an array in javascript
let cars = ['BMW', 'Benz', 'Audi'];
cars.pop(); // ['BMW', 'Benz']