var str = "Hello"; var newString = str.substring(0, str.length - 1); //newString = Hell
var colors = ["red","blue","green"]; colors.pop();
array.pop(); //returns popped element //example var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.pop(); // fruits= ["Banana", "Orange", "Apple"];
var array = [1, 2, 3, 4, 5, 6]; array.pop(); console.log(array); //Output in console section: //[1, 2, 3, 4, 5]
array.pop(); // Example var colors = ['Yellow', 'Red', 'Blue', 'Green']; var removedColor = colors.pop(); // Green console.log(colors); // ['Yellow', 'Red', 'Blue']
array.pop();
let str = "12345.00"; str = str.substring(0, str.length - 1); console.log(str);
arr.splice(-1,1)
const text = 'abcdef' const editedText = text.slice(0, -1) //'abcde'
array.splice(-1,1)