String.prototype.atintermediateconst 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.
Challenge: Implement middleChar(str) that returns the middle character of an odd-length string using .at().
middleChar('hello') // β 'l'
middleChar('abc') // β 'b'