DEV Community

Discussion on: Daily Challenge #37 - Name Swap

Collapse
asg5704 profile image
Alexander Garcia

Just because I'm lazy

const nameShuffler = (name) => {

  const [first, last] = [...name.split(' ')]

  return `${last} ${first}`

}