String.prototype.atbeginnerconst str = 'Hello'
str.at(0) // β 'H'
str.at(-1) // β 'o'
str.at(1) // β 'e'Use at() to access a character by index, supporting negative indices to count from the end.
String.prototype.at(index) returns the character at the given index. For non-negative indices it behaves like bracket notation, but it also accepts negative indices.
Challenge: Implement getChar(str, i) that returns the character at index i using .at().
getChar('hello', 0) // β 'h'
getChar('hello', 1) // β 'e'