Getting the first character in a string is fairly straightforward.
const str = 'abc'
str[0] // 'a'
However, when javascript sees a unicode string, it will return the first byte of a multi-byte unicode character.
const strUnicode = 'hi'
strUnicode[0] // '�'
Is it possible to return the first complete unicode character?
const strUnicode = 'hi'
f(strUnicode) // ''