首页 > 代码库 > [Ramda] Simple log function for debugging Compose function

[Ramda] Simple log function for debugging Compose function

const log = function(x){  console.log(x);  return x;}const get = R.curry(function(prop, obj){  return obj[prop];})var people = [  {name: "Wan"},  {name: "Zhentian"}];var res = R.compose(  get(‘name‘),  log,  R.head)(people);console.log(res);

 

[Ramda] Simple log function for debugging Compose function