javascript how to get the last character of a string

JavaScript
var hello = "Hello World";
var lastCharOfHello=hello.slice(-1);//d
Source

Also in JavaScript: