javascript substring last character

JavaScript
var hello = "Hello World";
var lastCharOfHello=hello.slice(-1);//dconst id = "ctl03_Tabs1";
console.log(id.slice(id.length - 5)); //Outputs: Tabs1
console.log(id.slice(id.length - 1)); //Outputs: 1'abc'.slice(-1); // c
Source

Also in JavaScript: