|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
636 bytes
|
| Line | |
|---|
| 1 | var createWrap = require('./_createWrap');
|
|---|
| 2 |
|
|---|
| 3 | /** Used to compose bitmasks for function metadata. */
|
|---|
| 4 | var WRAP_FLIP_FLAG = 512;
|
|---|
| 5 |
|
|---|
| 6 | /**
|
|---|
| 7 | * Creates a function that invokes `func` with arguments reversed.
|
|---|
| 8 | *
|
|---|
| 9 | * @static
|
|---|
| 10 | * @memberOf _
|
|---|
| 11 | * @since 4.0.0
|
|---|
| 12 | * @category Function
|
|---|
| 13 | * @param {Function} func The function to flip arguments for.
|
|---|
| 14 | * @returns {Function} Returns the new flipped function.
|
|---|
| 15 | * @example
|
|---|
| 16 | *
|
|---|
| 17 | * var flipped = _.flip(function() {
|
|---|
| 18 | * return _.toArray(arguments);
|
|---|
| 19 | * });
|
|---|
| 20 | *
|
|---|
| 21 | * flipped('a', 'b', 'c', 'd');
|
|---|
| 22 | * // => ['d', 'c', 'b', 'a']
|
|---|
| 23 | */
|
|---|
| 24 | function flip(func) {
|
|---|
| 25 | return createWrap(func, WRAP_FLIP_FLAG);
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | module.exports = flip;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.