> For the complete documentation index, see [llms.txt](https://docs.hong97.ltd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hong97.ltd/javascript/lei-xing-zhi/zi-fu-chuan.md).

# 字符串

## 概念

字符串并不是 `char` 数组。只是 `String.prototype` 内提供了一些和数组相似的函数。

在对基本类型 `string` 调用这些函数的时候，会自动封装成对应的 `String` 对象。

他和 “数组” 的区别在于：字符串不可变，数组可变。字符串的所有成员函数不会在原始值上修改，而是返回一个新的字符串。这个与数组不同。
