DEV Community

Cover image for Codewars - Friend or Foe?
Nicolás Bost
Nicolás Bost

Posted on

Codewars - Friend or Foe?

Salutations.

Ralph says hi

I'm posting Codewars challenges and my thought process in this series. I'm using JS and Node 18 whenever possible. Just for the sake of clarity, I'm making fair use of them.

"Friend or Foe?" can be simply done like this:

function friend(friends){
  let trueFriends = friends.filter((dude) => dude.length==4 );
  return trueFriends;
}
Enter fullscreen mode Exit fullscreen mode

Generally performant, and a simple solution. Does the job.

Regards. Drink water 💧💧💧.

Previous

Top comments (0)

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay