R stands for the Ramda.js library, similar to the Underscore.js
var test = [
{p1: 1}
];
var get = R.curry(function(prop, obj) { return obj[prop]; });
console.log(R.map(get('p1'), test));
what i know about the R.map callback that it takes only one argument but here we passed two arguments prop, obj and it's working ?
we didn't use obj so it should be undefined --> return undefined[prop] right ?
this code prove that map callback takes only one argument
var test = [
{p1: 1}
];
function fn(arg1, arg2) {
return arg1 + ' ' + arg2 + '\n';
}
console.log(R.map(fn, test));
the result is
["[object Object] undefined"]