COLLECTED BY
Organization:
Internet Archive
Focused crawls are collections of frequently-updated webcrawl data from narrow (as opposed to broad or wide) web crawls, often focused on a single domain or subdomain.
The Wayback Machine - https://web.archive.org/web/20201220220942/https://github.com/lodash/lodash/blob/master/flip.js
Permalink
Cannot retrieve contributors at this time
25 lines (24 sloc)
582 Bytes
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @since 4.0.0
* @category Function
* @param {Function } func The function to flip arguments for.
* @returns {Function } Returns the new flipped function.
* @see reverse
* @example
*
* const flipped = flip((...args) => args)
*
* flipped('a', 'b', 'c', 'd')
* // => ['d', 'c', 'b', 'a']
*/
function flip ( func ) {
if ( typeof func !== 'function' ) {
throw new TypeError ( 'Expected a function' )
}
return function ( ...args ) {
return func . apply ( this , args . reverse ( ) )
}
}
export default flip
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.