How to use the nthArg function from ramda

Find comprehensive JavaScript ramda.nthArg code examples handpicked from public code repositorys.

0
1
2
3
4
5
6
7
8
9
10
const R = require('ramda')


// :: String -> Array -> Object
const findById = R.converge(R.find, [
    R.pipe(
        R.nthArg(0),
        R.propEq('id')
    ),
    R.nthArg(1)
])
fork icon0
star icon0
watch icon0

+ 3 other calls in file

3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
 * @sig Number -> *... -> *
 * @param {Number} n
 * @return {Function}
 * @example
 *
 *      R.nthArg(1)('a', 'b', 'c'); //=> 'b'
 *      R.nthArg(-1)('a', 'b', 'c'); //=> 'c'
 */
var nthArg = _curry1(function nthArg(n) {
    var arity = n < 0 ? 1 : n + 1;
fork icon0
star icon0
watch icon0

+ 35 other calls in file

10471
10472
10473
10474
10475
10476
10477
10478
10479
* @return {Function}
* @example
*
*      R.nthArg(1)('a', 'b', 'c'); //=> 'b'
*      R.nthArg(-1)('a', 'b', 'c'); //=> 'c'
* @symb R.nthArg(-1)(a, b, c) = c
* @symb R.nthArg(0)(a, b, c) = a
* @symb R.nthArg(1)(a, b, c) = b
*/
fork icon0
star icon0
watch icon2

+ 19 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)