char_code_at_j

Function char_code_at_j 

Source
pub fn char_code_at_j(s: &JsString, index: i64) -> Option<u16>
Expand description

Returns the UTF-16 code unit at index, matching JS charCodeAt.

In JavaScript, String.prototype.charCodeAt() returns NaN when the index is out of bounds. This helper returns None in that case.

index is interpreted as a UTF-16 code-unit index.