# 转换方法

```javascript
{
  let color = ['red','blue','green'];
  console.info(color.toString());
  console.log(color.valueOf());
  console.log(color);
}
```

通过试验可以看到

![](https://2749833347-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MGDQNxeIHqAznfqMZXF%2Fsync%2Fc5dcef6236750215eb26991bbefdf4822966ea8e.png?generation=1599043657944059\&alt=media)
