javascript select letter in string

JavaScript
const str = 'Hello';
str.substring(0, 2); // => 'Hel'
Source

Also in JavaScript: