## take
+ [link](./take "Link to this entry.")
+ [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6654 "View in source.")
+ [npm](https://www.npmjs.com/package/lodash.take "See the npm package.")
```
_.take(array, [n=1])
```
从数组的起始元素开始提取 N 个元素。
### 参数
1. array (Array)
需要处理的数组
2. [n=1] (number)
要提取的个数
### 返回值 (Array)
返回提取的元素数组
### 示例
```
_.take([1, 2, 3]);
// => [1]
_.take([1, 2, 3], 2);
// => [1, 2]
_.take([1, 2, 3], 5);
// => [1, 2, 3]
_.take([1, 2, 3], 0);
// => []
```
- 主页
- 入门指南
- 下载
- 引入
- 模块格式
- 深入了解
- 兼容性
- 版本定制
- Array
- chunk
- compact
- concat
- difference
- differenceBy
- differenceWith
- drop
- dropRight
- dropRightWhile
- dropWhile
- fill
- findIndex
- findLastIndex
- flatten
- flattenDeep
- flattenDepth
- fromPairs
- head first
- indexOf
- initial
- intersection
- intersectionBy
- intersectionWith
- join
- last
- lastIndexOf
- prototype.reverse
- pull
- pullAll
- pullAllBy
- pullAt
- remove
- slice
- sortedIndex
- sortedIndexBy
- sortedIndexOf
- sortedLastIndex
- sortedLastIndexBy
- sortedLastIndexOf
- sortedUniq
- sortedUniqBy
- tail
- take
- takeRight
- takeRightWhile
- takeWhile
- union
- unionBy
- unionWith
- uniq
- uniqBy
- uniqWith
- unzip
- unzipWith
- without
- xor
- xorBy
- xorWith
- zip
- zipObject
- zipObjectDeep
- zipWith
- Collection
- countBy
- every
- filter
- find
- findLast
- flatMap
- forEach each
- forEachRight eachRight
- groupBy
- includes
- invokeMap
- keyBy
- map
- orderBy
- partition
- reduce
- reduceRight
- reject
- sample
- sampleSize
- shuffle
- size
- some
- sortBy
- Date
- now
- Function
- after
- ary
- before
- bind
- bindKey
- curry
- curryRight
- debounce
- defer
- delay
- flip
- memoize
- negate
- once
- overArgs
- partial
- partialRight
- rearg
- rest
- spread
- throttle
- unary
- wrap
- Lang
- castArray
- clone
- cloneDeep
- cloneDeepWith
- cloneWith
- eq
- gt
- gte
- isArguments
- isArray
- isArrayBuffer
- isArrayLike
- isArrayLikeObject
- isBoolean
- isBuffer
- isDate
- isElement
- isEmpty
- isEqual
- isEqualWith
- isError
- isFinite
- isFunction
- isInteger
- isLength
- isMap
- isMatch
- isMatchWith
- isNaN
- isNative
- isNil
- isNull
- isNumber
- isObject
- isObjectLike
- isPlainObject
- isRegExp
- isSafeInteger
- isSet
- isString
- isSymbol
- isTypedArray
- isUndefined
- isWeakMap
- isWeakSet
- lt
- lte
- toArray
- toInteger
- toLength
- toNumber
- toPlainObject
- toSafeInteger
- toString
- Math
- add
- ceil
- floor
- max
- maxBy
- mean
- min
- minBy
- round
- subtract
- sum
- sumBy
- Methods
- templateSettings.imports._
- Number
- clamp
- inRange
- random
- Object
- assign
- assignIn extend
- assignInWith extendWith
- assignWith
- at
- create
- defaults
- defaultsDeep
- findKey
- findLastKey
- forIn
- forInRight
- forOwn
- forOwnRight
- functions
- functionsIn
- get
- has
- hasIn
- invert
- invertBy
- invoke
- keys
- keysIn
- mapKeys
- mapValues
- merge
- mergeWith
- omit
- omitBy
- pick
- pickBy
- result
- set
- setWith
- toPairs
- toPairsIn
- transform
- unset
- values
- valuesIn
- Properties
- templateSettings
- templateSettings.escape
- templateSettings.evaluate
- templateSettings.imports
- templateSettings.interpolate
- templateSettings.variable
- VERSION
- Seq
- _
- chain
- prototype.at
- prototype.chain
- prototype.commit
- prototype.next
- prototype.plant
- prototype.Symbol.iterator
- prototype.value run, toJSON, valueOf
- tap
- thru
- wrapperFlatMap
- String
- camelCase
- capitalize
- deburr
- endsWith
- escape
- escapeRegExp
- kebabCase
- lowerCase
- lowerFirst
- pad
- padEnd
- padStart
- parseInt
- repeat
- replace
- snakeCase
- split
- startCase
- startsWith
- template
- toLower
- toUpper
- trim
- trimEnd
- trimStart
- truncate
- unescape
- upperCase
- upperFirst
- words
- Util
- attempt
- bindAll
- cond
- conforms
- constant
- flow
- flowRight
- identity
- iteratee
- matches
- matchesProperty
- method
- methodOf
- mixin
- noConflict
- noop
- nthArg
- over
- overEvery
- overSome
- property
- propertyOf
- range
- rangeRight
- runInContext
- times
- toPath
- uniqueId