# .toOrdArray()

## Description

toOrdArray converts a string to an array of UTF-8 byte values, returning each character's ordinal value in the UTF-8 encoding.

## Parameters

toOrdArray takes no parameters.

## Usage On Strings

```javascript
str = "Hello"
log str.toOrdArray()
// ["72", "101", "108", "108", "111"]
// Returns array of UTF-8 byte values

str = "🌟"
log str.toOrdArray()
// ["240", "159", "140", "159"]
// Unicode characters may use multiple bytes

str = ""
log str.toOrdArray()
// []
// Empty string returns empty array

// Can be used with .ord() for single characters
str = "A"
log str.toOrdArray()
// ["65"]
// Same as str.ord() for single characters
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://osl.mistium.com/methods/strings/.toordarray.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
