JavaScript mendapatkan karakter terakhir dari string
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
Grepper
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
"somestring0".slice(0, -1)
// "somestring"
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
var id = "ctl03_Tabs1";
var lastFive = id.substr(id.length - 5); // => "Tabs1"
var lastChar = id.substr(id.length - 1); // => "1"