mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Add more _.toArray doc examples. [ci skip]
This commit is contained in:
15
lodash.js
15
lodash.js
@@ -10113,10 +10113,17 @@
|
||||
* @returns {Array} Returns the converted array.
|
||||
* @example
|
||||
*
|
||||
* (function() {
|
||||
* return _.toArray(arguments).slice(1);
|
||||
* }(1, 2, 3));
|
||||
* // => [2, 3]
|
||||
* _.toArray({ 'a': 1, 'b': 2 });
|
||||
* // => [1, 2]
|
||||
*
|
||||
* _.toArray('abc');
|
||||
* // => ['a', 'b', 'c']
|
||||
*
|
||||
* _.toArray(1);
|
||||
* // => []
|
||||
*
|
||||
* _.toArray(null);
|
||||
* // => []
|
||||
*/
|
||||
function toArray(value) {
|
||||
if (!value) {
|
||||
|
||||
Reference in New Issue
Block a user