JavaScript Length
length is a property, not a method. It reports how many UTF-16 code units a string contains. For plain ASCII text this equals the visible character count.
Syntax
str.length Examples
| Input | Arguments | Output |
|---|---|---|
| "hello" | — | 5 |
| "😀" | — | 2 |
| ↳ Emoji count as 2 UTF-16 units. | ||
Try it live
Type your input and see Length transform it instantly.
Want to go further? Chain Length with other functions, pipe one output into the next and watch your data transform in the visual Playground.