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.
Negative indices count from the end: -1 is the last character, -2 is the second-to-last, etc.
Challenge: Implement lastChar(str) that returns the last character using .at(-1).
lastChar('hello') // β 'o'
lastChar('abc') // β 'c'