> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/lang/clone.md).

# \_.clone（数据的浅克隆）

**语法：**

```javascript
_.chunk(array, [size=1])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L11028)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.clone)

**描述：**

创建一个`value`的浅克隆。

**注意**: 这个方法参考自[structured clone algorithm](https://mdn.io/Structured_clone_algorithm)以及支持 arrays、array buffers、 booleans、 date objects、maps、 numbers，`Object`对象, regexes, sets, strings, symbols, 以及 typed arrays。`arguments`对象的可枚举属性会克隆为普通对象。 一些不可克隆的对象，例如error objects、functions, DOM nodes, 以及 WeakMaps 会返回空对象。

**开始版本：**&#x30;.1.0

**参数：**

* `value (*)`: 要克隆的值

**返回值：**

* `(*)`: 返回克隆后的值。

**例子：**

```javascript
var objects = [{ 'a': 1 }, { 'b': 2 }];

var shallow = _.clone(objects);
console.log(shallow[0] === objects[0]);
// => true
```
