> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/val/prim/str/method/str.map.md).

# str.map()

{% tabs %}
{% tab title=".map()" %}

```javascript
// ⭐️ string.map()
String.prototype.map = function (mapf) {
    return Array.prototype.map.call(this, mapf);
};

// mapString(str, mapf)
export function mapString(str, mapf){
    return Array.prototype.map.call(str, mapf);
};
```

{% endtab %}

{% tab title="👥 相關" %}

* [helpers](/web/appendix/custom/helper-functions.md)
  {% endtab %}
  {% endtabs %}
