Answers for "remove last p javascript"

28

Javascript remove last character

var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
Posted by: Guest on July-23-2019
7

how to remove last element in js

var array = [1, 2, 3, 4, 5, 6];
array.pop();
console.log(array);
//Output in console section:
//[1, 2, 3, 4, 5]
Posted by: Guest on August-06-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language