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

93
Views
how to replace part of a string in javascript and wait for the task to finish before continuing with rest of code
let searchKeyword = 'hi'
Array[lastIndex]= await Array[lastIndex].replace(searchKeyword,'user_id:12345,"email":mail') /*wait for this line of code to finish executing, before continuing on with rest of code */
logger.info('hi')

do i have to use promises, I tried using await but it says await has no affect on this type of expression. i have more code but this is just the basic idea I am trying to accomplish, I am still new with asynchronous programming and learn about await and promises

about 4 years ago · Santiago Trujillo
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!