JavaScript Merge two properties together in ramda.js

I was wondering if there is a better way to do this:

var books = [
   { 
      title: 'Some Book',
      author: {
         firstName: 'John',
         lastName: 'Doe'
      }
   },
   {
      title: 'Another Book',
      author: {
         firstName: 'Jane',
         lastName: 'Smith'
      }
   }
];

var getNames = R.pipe(
   R.prop('author'),
   R.props(['firstName', 'lastName']),
   R.join(' ')
);

console.log(R.map(getNames, books));

So basically, I am trying to get the full names by combining two properties together. This works, but I was wondering if there is a better (shorter) way to do this in Ramda? I went through the documentation, but there are some functions that I don't quite understand the usage of, yet. So that's why I am asking here.. :)

fiddle: https://jsbin.com/jidiwejatu/edit?js,console

------------------- EDIT -----------------

This is rather a simple example, but if I had to merge properties from different paths, that's what becomes more complicated I think, since I would have to use R.path to get to each property. Am I right?

Answer:1

I have searched in many ways to get the solution of this problem but not found any working solution. I have visited many questions on this platform but not found any working solution. I know that i ...

I have searched in many ways to get the solution of this problem but not found any working solution. I have visited many questions on this platform but not found any working solution. I know that i ...

I am trying to make a append menu on click div. But i have one question here. How can i remove appended elements after second click. Anyone can help me in this regard ? This is the DEMO page from ...

I am trying to make a append menu on click div. But i have one question here. How can i remove appended elements after second click. Anyone can help me in this regard ? This is the DEMO page from ...

  1. jquery click append
  2. jquery click append element
  3. jquery click append div
  4. jquery click append html
  5. jquery append click event
  6. jquery append click not working
  7. jquery append click handler
  8. jquery append click function
  9. jquery click after append
  10. jquery button click append div
  11. jquery after append click not working
  12. jquery click event after append
  13. jquery click event on append element
  14. jquery click function after append
  15. jquery append add click event
  16. jquery click doesn't work after append
  17. jquery click on element after append
  18. jquery bind click after append
  19. jquery trigger click after append

I understand that when index names are used to push values in Javascript, they essentially work like objects. But what I don't understand is the following behaviour - person = []; person[0] = "...

I understand that when index names are used to push values in Javascript, they essentially work like objects. But what I don't understand is the following behaviour - person = []; person[0] = "...

I am new with javascript. I want to display a message in the client side if a person press a button continuously. So I think it is better to use a javascript code to show an Alert message if someone ...

I am new with javascript. I want to display a message in the client side if a person press a button continuously. So I think it is better to use a javascript code to show an Alert message if someone ...

  1. alert next line
  2. alert next line javascript