[][src]Function boa::builtins::string::char_at

pub fn char_at(
    this: &mut Value,
    args: &[Value],
    ctx: &mut Interpreter
) -> ResultValue

String.prototype.charAt( index )

The String object's charAt() method returns a new string consisting of the single UTF-16 code unit located at the specified offset into the string.

Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character—in a string called stringName—is stringName.length - 1. If the index you supply is out of this range, JavaScript returns an empty string.

If no index is provided to charAt(), the default is 0.

More information: