Strings In Depth10 / 18
Up next

Character with at()

const s = "abc";
// at() accepts negative indices and may be undefined
const last: string | undefined = s.at(-1);
console.log(s.at(0), last);
What you're solving

at() returns string | undefined