1. Get the first character
var str = "hello word"; console.log(str[0]); // h
2, access to the last character
var str = "hello word"; console.log(str[str.length - 1]); // d
var str = "hello word"; console.log(str[0]); // h
var str = "hello word"; console.log(str[str.length - 1]); // d