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

248
Views
Where to put the .join in this function in order to rejoin the separated strings of an array

Problem to solve is to capitlize the first letter of each word in a string using '.split' '.map' and 'join'. Currently implemented split and map to get the word capitlised and rejoined it, but confused as to where I need to put the .join.

Expected: "The Lord Of The Rings"
Received: ["The", "Lord", "Of", "The", "Rings"]

function titleCase(string) {
  return string.split(' ').map(word => word.charAt(0).toUpperCase() + word.substr(1))
  

}

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

0

First: split the string

Second: Capitalize word

Third: Join words

return string.split(' ').map(word => word.charAt(0).toUpperCase() + word.substr(1)).join(' ');
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!