Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Remove All Strings From Array, But Keep Strings With Specific Length in JavaScript

I am trying to make Wordle in React. For that I need a list of Strings. I am getting an array of strings from this API: https://random-word-api.herokuapp.com/all

The problem is that I don't want every word. I only want words that has a length of 5. How do I remove all the strings that doesn't have a length of 5 from the array?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Assuming you have an array of words, words, use Array#filter.

const fiveLetterWords = words.filter(w => w.length === 5)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!