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.
Both positive out-of-bounds and very negative indices return undefined.
Challenge: Implement safeAt(str, i) that uses .at(i) and returns '?' if the result is undefined.
safeAt('hi', 0) // β 'h'
safeAt('hi', 99) // β '?'