Home > Web Front-end > JS Tutorial > Codewars - Friend or Foe?

Codewars - Friend or Foe?

Linda Hamilton
Release: 2025-01-04 01:58:38
Original
798 people have browsed it

Salutations.

Codewars - Friend or Foe?

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;
}
Copy after login

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

Regards. Drink water ???.

Previous

The above is the detailed content of Codewars - Friend or Foe?. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template